From b815eea5b2916eba98cf94921752eb93df0e9951 Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 06:25:43 +0300 Subject: [PATCH 1/9] feat: added snow --- .../src/app/components/Snowflakes.tsx | 159 ++++++++++++++++++ .../src/app/components/models/Snowflake.tsx | 10 ++ .../src/app/components/styles/snowflakes.css | 18 ++ .../app/components/styles/snowflakesMedia.css | 32 ++++ 4 files changed, 219 insertions(+) create mode 100644 apps/js-machine-front/src/app/components/Snowflakes.tsx create mode 100644 apps/js-machine-front/src/app/components/models/Snowflake.tsx create mode 100644 apps/js-machine-front/src/app/components/styles/snowflakes.css create mode 100644 apps/js-machine-front/src/app/components/styles/snowflakesMedia.css diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx new file mode 100644 index 0000000..8606ee1 --- /dev/null +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -0,0 +1,159 @@ +import React, { useEffect, useState } from 'react'; + +import './styles/snowflakes.css'; +import './styles/snowflakesMedia.css'; +import { Snowflake } from './models/Snowflake'; + +import Switch from '@material-ui/core/Switch'; +import { makeStyles } from '@material-ui/core/styles'; + +export function Snowflakes() { + + const [isSnowing, setSnowing] = useState(true); + const requestId = React.useRef(0); + + useEffect(() => { + startSnowflakes(); + }); + + function startSnowflakes() { + let canvas: any = document.getElementById("snow"), + ctx: CanvasRenderingContext2D = canvas.getContext("2d"); + + if (!isSnowing) { + window.cancelAnimationFrame(requestId.current); + ctx.clearRect(0, 0, canvas.width, canvas.height); + return; + } + + let flakesAmoung = getFlakesAmoungByWindowSize(); + let flakes: Snowflake[] = createSnowflakes(flakesAmoung); + + window.addEventListener("resize", function () { + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + }); + + + snowStep(); + + function getFlakesAmoungByWindowSize() { + if (innerWidth < 500) { + return (60); + } else if (innerWidth < 750) { + return (80); + } else if (innerWidth < 1000) { + return (100) + } else if (innerWidth < 1200) { + return (120); + } else if (innerWidth < 1600) { + return (160) + } else { + return (180); + } + } + + function snowStep() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + for (let i = 0; i < flakes.length; i++) { + let flake: Snowflake = flakes[i]; + + flake.speedX *= .98; + flake.speedX += Math.cos(flake.step += .05) * flake.stepSize; + + flake.y += flake.speedY; + flake.x += flake.speedX; + + if (flake.y >= canvas.height || flake.y <= 0) { + reset(flake); + } + + if (flake.x >= canvas.width || flake.x <= 0) { + reset(flake); + } + + ctx.beginPath(); + ctx.fillStyle = "rgba(255,255,255," + flake.opacity + ")"; + ctx.arc(flake.x, flake.y, flake.size, 0, Math.PI * 2); + ctx.fill(); + } + requestId.current = requestAnimationFrame(snowStep); + }; + + function reset(flake: Snowflake) { + flake.x = Math.floor(Math.random() * canvas.width); + flake.y = 0; + flake.size = (Math.random() * 3) + 2; + flake.speedY = (Math.random() * 1) + 0.5; + flake.speedX = 0; + flake.opacity = (Math.random() * 0.5) + 0.3; + } + + function createSnowflakes(flakeCount: number): Snowflake[] { + let flakes: Snowflake[] = []; + for (let i = 0; i < flakeCount; i++) { + let x = Math.floor(Math.random() * canvas.width), + y = Math.floor(Math.random() * canvas.height), + size = (Math.random() * 3) + 2, + speedY = (Math.random() * 1) + 0.5, + opacity = (Math.random() * 0.5) + 0.3; + + flakes.push({ + speedY: speedY, + speedX: 0, + x: x, + y: y, + size: size, + stepSize: (Math.random()) / 30, + step: 0, + opacity: opacity + }); + } + return flakes; + }; + } + + const useStyles: any = makeStyles({ + colorSecondary: { + '&$checked': { + color: '#f2e14c' + } + }, + switchBase: { + color: 'white', + '&$checked': { + color: 'white', + '& + $track': { + backgroundColor: '#f2e14c', + opacity: 1, + }, + "&:hover": { + backgroundColor: '#f2e14c4d', + } + }, + '&$focusVisible $thumb': { + color: '#f2e14c', + }, + }, + track: {}, + checked: {}, + }); + + const classes = useStyles(); + + return ( + <> +
+ Happy New Year + setSnowing(!isSnowing)}> + +
+ + + ); +} \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/models/Snowflake.tsx b/apps/js-machine-front/src/app/components/models/Snowflake.tsx new file mode 100644 index 0000000..5b24955 --- /dev/null +++ b/apps/js-machine-front/src/app/components/models/Snowflake.tsx @@ -0,0 +1,10 @@ +export interface Snowflake { + speedY: number, + speedX: number, + x: number, + y: number, + size: number, + stepSize: number, + step: number, + opacity: number +} \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/styles/snowflakes.css b/apps/js-machine-front/src/app/components/styles/snowflakes.css new file mode 100644 index 0000000..ea90a9f --- /dev/null +++ b/apps/js-machine-front/src/app/components/styles/snowflakes.css @@ -0,0 +1,18 @@ +#snow { + position: fixed; + height: 100%; + width: 100%; + z-index: 1; + pointer-events: none; +} + +.snow-switcher { + display: flex; + position: absolute; + z-index: 1101; + color: white; +} + +.snow-switcher__label { + font-size: 0.9rem;; +} \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css b/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css new file mode 100644 index 0000000..de527a7 --- /dev/null +++ b/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css @@ -0,0 +1,32 @@ +@media screen and (min-width: 960px) { + .snow-switcher { + top: 27px; + left: 28px; + } +} + +@media screen and (max-width: 959px) { + .snow-switcher { + top: 14px; + left: 18px; + } +} + +@media screen and (max-width: 600px) { + .snow-switcher { + top: 0px; + left: 0px; + flex-direction: row-reverse; + } +} + +@media screen and (max-width: 600px) and (orientation: landscape) { + .snow-switcher { + top: -2px; + left: -4px; + } + + .snow-switcher__label { + font-size: 0.9rem; + } +} \ No newline at end of file From 5fe9619305a3c297dab51a8699c0f608754bb3aa Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 08:07:20 +0300 Subject: [PATCH 2/9] fix: fixed mistake --- apps/js-machine-front/src/app/App.tsx | 2 ++ apps/js-machine-front/src/app/components/Snowflakes.tsx | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/js-machine-front/src/app/App.tsx b/apps/js-machine-front/src/app/App.tsx index ebbc82b..430403e 100644 --- a/apps/js-machine-front/src/app/App.tsx +++ b/apps/js-machine-front/src/app/App.tsx @@ -13,6 +13,7 @@ import { Authorization } from './scenes/authorization/Authorization'; import { Route, Redirect, Switch, Router } from 'react-router'; import { ThemeProvider } from '@material-ui/styles'; import { SnackbarProvider } from 'notistack'; +import { Snowflakes } from './components/Snowflakes'; // Internationalization import { intl } from './i18n/messages'; @@ -36,6 +37,7 @@ export const App: React.FC = observer(() => { + diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index 8606ee1..0206df5 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -117,7 +117,7 @@ export function Snowflakes() { colorSecondary: { '&$checked': { color: '#f2e14c' - } + }, }, switchBase: { color: 'white', @@ -129,10 +129,7 @@ export function Snowflakes() { }, "&:hover": { backgroundColor: '#f2e14c4d', - } - }, - '&$focusVisible $thumb': { - color: '#f2e14c', + }, }, }, track: {}, From 0f7d9b123e10c26a43ce3c1f3fcecd301f28c86d Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 09:02:42 +0300 Subject: [PATCH 3/9] fix: lint front mistakes --- .../src/app/components/Snowflakes.tsx | 54 +++++++++++++------ 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index 0206df5..f84fc87 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -16,9 +16,30 @@ export function Snowflakes() { startSnowflakes(); }); + const getCanvasElementById = (id: string): HTMLCanvasElement => { + const canvas = document.getElementById(id); + + if (!(canvas instanceof HTMLCanvasElement)) { + throw new Error(`The element of id "${id}" is not a HTMLCanvasElement. Make sure a element is present in the document.`); + } + + return canvas; + } + + const getCanvasRenderingContext2D = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => { + const context = canvas.getContext('2d'); + + if (!(context instanceof CanvasRenderingContext2D)) { + throw new Error('This browser does not support 2-dimensional canvas rendering contexts.'); + } + + return context; + } + function startSnowflakes() { - let canvas: any = document.getElementById("snow"), - ctx: CanvasRenderingContext2D = canvas.getContext("2d"); + + const canvas: HTMLCanvasElement = getCanvasElementById('snow'); + const ctx: CanvasRenderingContext2D = getCanvasRenderingContext2D(canvas); if (!isSnowing) { window.cancelAnimationFrame(requestId.current); @@ -26,8 +47,8 @@ export function Snowflakes() { return; } - let flakesAmoung = getFlakesAmoungByWindowSize(); - let flakes: Snowflake[] = createSnowflakes(flakesAmoung); + const flakesAmoung = getFlakesAmoungByWindowSize(); + const flakes: Snowflake[] = createSnowflakes(flakesAmoung); window.addEventListener("resize", function () { canvas.width = window.innerWidth; @@ -38,15 +59,16 @@ export function Snowflakes() { snowStep(); function getFlakesAmoungByWindowSize() { - if (innerWidth < 500) { + const width = window.innerWidth; + if (width < 500) { return (60); - } else if (innerWidth < 750) { + } else if (width < 750) { return (80); - } else if (innerWidth < 1000) { + } else if (width < 1000) { return (100) - } else if (innerWidth < 1200) { + } else if (width < 1200) { return (120); - } else if (innerWidth < 1600) { + } else if (width < 1600) { return (160) } else { return (180); @@ -56,7 +78,7 @@ export function Snowflakes() { function snowStep() { ctx.clearRect(0, 0, canvas.width, canvas.height); for (let i = 0; i < flakes.length; i++) { - let flake: Snowflake = flakes[i]; + const flake: Snowflake = flakes[i]; flake.speedX *= .98; flake.speedX += Math.cos(flake.step += .05) * flake.stepSize; @@ -90,9 +112,9 @@ export function Snowflakes() { } function createSnowflakes(flakeCount: number): Snowflake[] { - let flakes: Snowflake[] = []; + const flakes: Snowflake[] = []; for (let i = 0; i < flakeCount; i++) { - let x = Math.floor(Math.random() * canvas.width), + const x = Math.floor(Math.random() * canvas.width), y = Math.floor(Math.random() * canvas.height), size = (Math.random() * 3) + 2, speedY = (Math.random() * 1) + 0.5, @@ -106,17 +128,17 @@ export function Snowflakes() { size: size, stepSize: (Math.random()) / 30, step: 0, - opacity: opacity + opacity: opacity, }); } return flakes; }; } - const useStyles: any = makeStyles({ + const useStyles = makeStyles({ colorSecondary: { '&$checked': { - color: '#f2e14c' + color: '#f2e14c', }, }, switchBase: { @@ -150,7 +172,7 @@ export function Snowflakes() { onClick={() => setSnowing(!isSnowing)}> - + ); } \ No newline at end of file From d70ec86768e855d8aea64e293df34ad7cd548ebc Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 10:11:43 +0300 Subject: [PATCH 4/9] fix: lint front mistakes --- .../src/app/components/Snowflakes.tsx | 9 +- package-lock.json | 773 +++++++++++------- 2 files changed, 474 insertions(+), 308 deletions(-) diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index f84fc87..eb13c33 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -24,7 +24,7 @@ export function Snowflakes() { } return canvas; - } + }; const getCanvasRenderingContext2D = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => { const context = canvas.getContext('2d'); @@ -34,7 +34,7 @@ export function Snowflakes() { } return context; - } + }; function startSnowflakes() { @@ -55,7 +55,6 @@ export function Snowflakes() { canvas.height = window.innerHeight; }); - snowStep(); function getFlakesAmoungByWindowSize() { @@ -65,11 +64,11 @@ export function Snowflakes() { } else if (width < 750) { return (80); } else if (width < 1000) { - return (100) + return (100); } else if (width < 1200) { return (120); } else if (width < 1600) { - return (160) + return (160); } else { return (180); } diff --git a/package-lock.json b/package-lock.json index f5d27e4..2c53e18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1840,184 +1840,184 @@ "integrity": "sha512-6PYY5DVdAY1ifaQW6XYTnOMihmBVT27elqSjEoodchsGjzYlEsTQMcEhSud99kVawatyTZRTiVkJ/c6lwbQ7nA==" }, "@firebase/analytics": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.2.8.tgz", - "integrity": "sha512-45U20f8TfMgNWrSk10925UrSLGnTC/p+iTGXRR7nzJLiPsV48suscbJwpD7NmzxPPKAWyxHNSnHE0aIanxkGQA==", - "requires": { - "@firebase/analytics-types": "0.2.4", - "@firebase/component": "0.1.0", - "@firebase/installations": "0.3.7", - "@firebase/util": "0.2.35", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.2.9.tgz", + "integrity": "sha512-ejKZp5+YDL5CAbuId3vtqwtvVbQfdDmP9ushwtEswrKKfNpdJV8djRpFpolj/AtNn5XIk5a80xmPWKnDaVWk/A==", + "requires": { + "@firebase/analytics-types": "0.2.5", + "@firebase/component": "0.1.1", + "@firebase/installations": "0.3.8", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/analytics-types": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.2.4.tgz", - "integrity": "sha512-byGvFzzWFLwAI18g3BgUjNG3sBqV6tXt6K3htwveUT71aWbiPlcJE3nAmKFsUD6weiHfsGZS4FsVEqdtopqChg==" + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.2.5.tgz", + "integrity": "sha512-aa746gTiILMn9TPBJXaYhYqnCL4CQwd4aYTAZseI9RZ/hf117xJTNy9/ZTmG5gl2AqxV0LgtdHYqKAjRlNqPIQ==" }, "@firebase/app": { - "version": "0.4.26", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.4.26.tgz", - "integrity": "sha512-ECQGEcf1maT9Ce9+EWX+zsvjFF48bwSG8z/822k+3npYvj111S+G/1DoJGCLN+VxO+qhPVySDUlMjwDR7ugeNQ==", - "requires": { - "@firebase/app-types": "0.4.9", - "@firebase/component": "0.1.0", - "@firebase/logger": "0.1.32", - "@firebase/util": "0.2.35", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.5.0.tgz", + "integrity": "sha512-n1aT4qQlFJaf0Poo5AoU4HGWVfvZCr2WpohpvNYlfbXhbSbEidwVbQKxNHN0wujFCtnggf3XGcYoF+FPQxESKw==", + "requires": { + "@firebase/app-types": "0.5.0", + "@firebase/component": "0.1.1", + "@firebase/logger": "0.1.33", + "@firebase/util": "0.2.36", "dom-storage": "2.1.0", "tslib": "1.10.0", "xmlhttprequest": "1.8.0" } }, "@firebase/app-types": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.4.9.tgz", - "integrity": "sha512-RoUkYVd5X106sFGX+rHVDGrtfZBRugMtT9Cx8YiXtLSqouhi0S+Sx1TVuK6Gkt7lJ27I8qlz/nBvNa0yjg3N7w==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.5.0.tgz", + "integrity": "sha512-8j+vCXTpAkYGcFk86mPZ90V6HMFmn196RIEW9Opi0PN+VrPFC1l/eW0gptM8v7VXaQhECOxws3TN2g+dDaeSYA==" }, "@firebase/auth": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.13.2.tgz", - "integrity": "sha512-EHmKo4OMgLAWIqqvy45XwDSShDUo9S5TjZFk03h2/aF467WB8AvO3pW/b7kDbnlrK1HaZvn97jwKC71vvklBJw==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.13.3.tgz", + "integrity": "sha512-Ks+6PdLzuxrlkbnSbrMKpOdCbvrfJEBwXe2/GfHCDuJWsxUEx2qFcda+g04pgXnlf1qCjPeNEJM8U0WzTvGHyA==", "requires": { - "@firebase/auth-types": "0.9.2" + "@firebase/auth-types": "0.9.3" } }, "@firebase/auth-types": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.9.2.tgz", - "integrity": "sha512-e6raEvmGtV9BzZCtCaYQFKHOxcEBGen43xUEuA1mTRQnb0Hn93ctaEVd/uqjF+hWA6z3KR6wqP//mBCgoTTsUA==" + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.9.3.tgz", + "integrity": "sha512-eS9BEuZ1XxBQReUhG6lbus9ScOgHwqYPT7a645PKa/tBb1BWsgivwRFzH0BATPGLP+JTtRvy5JqEsQ25S7J4ig==" }, "@firebase/component": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.1.0.tgz", - "integrity": "sha512-l7UTwhmdKVHTWWD+OcBIzlbI5U/FbutSGWNiOxwaTq5nCau1LIC/9S+In9BnEgiTTCFY0CKeuM7H/rHcBZr5pA==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.1.1.tgz", + "integrity": "sha512-e9MrCYH10+CvGyJsuntdqH+Gtkbvm33GBEPprKClq9Qh36gXZxtvlUPwXACJfaD34tqxFB2V0pGi7i8iJUA+AA==", "requires": { - "@firebase/util": "0.2.35", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/database": { - "version": "0.5.15", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.15.tgz", - "integrity": "sha512-6GsZGDOoRbAaeBQjjbcKTCscEMV+qDXS1UWPmRYI0UBdhgCY05S1z5aNkjF2B3pFgkr35zDbVAdsQC+JhRCzLQ==", - "requires": { - "@firebase/component": "0.1.0", - "@firebase/database-types": "0.4.9", - "@firebase/logger": "0.1.32", - "@firebase/util": "0.2.35", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.16.tgz", + "integrity": "sha512-m8qrt3irSiSkFP9i75nGWFasZFeFb5KAR6/fvWOoLMXQWE41LU7Z+osUaXWvGvPJxsoHD0EY+4+Blat4XiJx9g==", + "requires": { + "@firebase/component": "0.1.1", + "@firebase/database-types": "0.4.10", + "@firebase/logger": "0.1.33", + "@firebase/util": "0.2.36", "faye-websocket": "0.11.3", "tslib": "1.10.0" } }, "@firebase/database-types": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.4.9.tgz", - "integrity": "sha512-VIATPku6NuLvDEIt5gkTx6xbtIFfQhATnySL4uoJ5udcVK6hH2KV0po58UPH72vQMtgrQ/clLGr6kkPgWRZw4Q==", + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.4.10.tgz", + "integrity": "sha512-66puLsckt5HASgRN3CfhLn2iuGrgCjfH3u17OL0f5MtEweYLx+yW2QW5d539Wx30xD4B+INEdaRetw6xEa9t7g==", "requires": { - "@firebase/app-types": "0.4.9" + "@firebase/app-types": "0.5.0" } }, "@firebase/firestore": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.8.1.tgz", - "integrity": "sha512-pElz88GKKDjdVdg4c3nDCizGtvFfHquvE99DPInKMjpEtZHsuPsAugULQPiTsrQKz7VZ/Lr1eXmoFu9zucVrlQ==", - "requires": { - "@firebase/component": "0.1.0", - "@firebase/firestore-types": "1.8.1", - "@firebase/logger": "0.1.32", - "@firebase/util": "0.2.35", - "@firebase/webchannel-wrapper": "0.2.33", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.9.0.tgz", + "integrity": "sha512-bcVfzGmj5qweUD1eYcezoCYeVl6oNlkc+s47EJBoNrmvWuvKeaiUy+RhB6hFblJCXUmecCuYUT2UA7CKipbEIQ==", + "requires": { + "@firebase/component": "0.1.1", + "@firebase/firestore-types": "1.9.0", + "@firebase/logger": "0.1.33", + "@firebase/util": "0.2.36", + "@firebase/webchannel-wrapper": "0.2.34", "@grpc/proto-loader": "^0.5.0", "grpc": "1.24.2", "tslib": "1.10.0" } }, "@firebase/firestore-types": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-1.8.1.tgz", - "integrity": "sha512-BAap8Oao47/oiJY00nhUFNuUdPVuvvD4vtQby88icLsuCgUy0Wrds54dmXyRFuQWGu8oOEFGpH8v1AomQx+zyg==" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-1.9.0.tgz", + "integrity": "sha512-UOtneGMUTLr58P56Y0GT/c4ZyC39vOoRAzgwad4PIsyc7HlKShbHKJpyys/LdlUYIsQdy/2El3Qy1veiBQ+ZJg==" }, "@firebase/functions": { - "version": "0.4.27", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.4.27.tgz", - "integrity": "sha512-LObi8DkxtbdoJSA7EyKfRTugkg0Ci7gp6cbQPZCoyb4wtSamXXl+sbotQGcXqrQLsXGWan38lvERJnLeEbSx5Q==", + "version": "0.4.28", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.4.28.tgz", + "integrity": "sha512-XrmMNtgnYj7ftekt6StBErZ1J6ltXaR8z/fY1AW1BZ/XqfX1x/piTSvFlWy/XbHI7UyCTjQGhIQlZgutMjWNRw==", "requires": { - "@firebase/component": "0.1.0", - "@firebase/functions-types": "0.3.12", - "@firebase/messaging-types": "0.3.6", + "@firebase/component": "0.1.1", + "@firebase/functions-types": "0.3.13", + "@firebase/messaging-types": "0.4.0", "isomorphic-fetch": "2.2.1", "tslib": "1.10.0" } }, "@firebase/functions-types": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.3.12.tgz", - "integrity": "sha512-4WjXJnh9I7UQw1ZYosoVyHIlXG11HwPjJ++2cAdaeOQugIDA9tL1xyURo1pivx9EY/mGIr8ITkmh3PnkWbtQEw==" + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.3.13.tgz", + "integrity": "sha512-wD075tCmZo+t/GHs5xMhi3irwjbc6SWnjXAIHjuNhVDKic5gQNkHH5QnxX930WPrPhD0RV9wuSP15fy9T1mvjw==" }, "@firebase/installations": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.3.7.tgz", - "integrity": "sha512-aYAw3Kk/AF/sJinqWFnfCQF2/CNWFof/bE0me3GUb0n5Hajj78QwPgdmYis5LHGeE1D/vG6lAEN7CYQ0Wqakjg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.3.8.tgz", + "integrity": "sha512-Dg1NOjyBOBV2uQrI30naSj05SuW9ByvP17tB+0uBxNf1ADJC/sG06SX2RSgV/YWnSI6+GPcE1BhGlm556pvZbQ==", "requires": { - "@firebase/component": "0.1.0", - "@firebase/installations-types": "0.2.3", - "@firebase/util": "0.2.35", + "@firebase/component": "0.1.1", + "@firebase/installations-types": "0.2.4", + "@firebase/util": "0.2.36", "idb": "3.0.2", "tslib": "1.10.0" } }, "@firebase/installations-types": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.2.3.tgz", - "integrity": "sha512-G+jeoRFdUih2P4GdnQM7X1WILs2cG+jf2N8QnaC5EdVYJu7f86BVtijCuLvSY3L4w606pZp7sjsIvTkCZbvGAA==" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.2.4.tgz", + "integrity": "sha512-rqObJmVk/JgPNafohoJL10UCbrk8nc5oMIfXWX+jnLKF5Ig3Tynp+9ZKV3VRtCI4N7633449WIkt+dUpgAtPeg==" }, "@firebase/logger": { - "version": "0.1.32", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.32.tgz", - "integrity": "sha512-txfDHzNS1M39cEDyrOjnpU/zP0vqpbK1ZOS9Rqqa3znjDdnO42AdtuY2UVBU0G5s5LAzawSaYA65AJB5tCVKLg==" + "version": "0.1.33", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.33.tgz", + "integrity": "sha512-EiewY1by3mYanihTa5Wsl2/gseFzmRmZr61YtVgQN5TXpX1OlQtqds6cCoR8Hh8VueeZJg6lTV9VLVQqu6iqHw==" }, "@firebase/messaging": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.5.8.tgz", - "integrity": "sha512-nPODbORCct7hiMnZyZPOHxrE7SBhKhIsi/z9hRdzof9C71KLaYtC+1Hq274D6dEOGBzly8HA4nQqDUlHJFbMLw==", - "requires": { - "@firebase/component": "0.1.0", - "@firebase/installations": "0.3.7", - "@firebase/messaging-types": "0.3.6", - "@firebase/util": "0.2.35", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.6.0.tgz", + "integrity": "sha512-eVPzdmnSXk3hdTRbo8/9epAOAgUdnc5cHJaKMR9bpGeihk3tgNxgWIydgaGXQZKTmnTa5ZikyNfu5kyxtwFV/A==", + "requires": { + "@firebase/component": "0.1.1", + "@firebase/installations": "0.3.8", + "@firebase/messaging-types": "0.4.0", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/messaging-types": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@firebase/messaging-types/-/messaging-types-0.3.6.tgz", - "integrity": "sha512-5D0BTAl2rONszYwsj6g0ZO7rVGBRk/xC3Z4KnOxxPofelBzcqwG6W/AjGwheTJ0lX4QVgaIn55PAKnTtBLSc8Q==" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@firebase/messaging-types/-/messaging-types-0.4.0.tgz", + "integrity": "sha512-szzmMLo1xn0RHGpnvsgFwDY0H7uAPc+V/mlw2jIlBUtZq0mAYspPwM8J9KkvdAMPTfsm/sgJb9r6DzbGNffDNg==" }, "@firebase/performance": { - "version": "0.2.27", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.2.27.tgz", - "integrity": "sha512-ULIplf3whbvNmHEDIqIVZkiI15YVqzBOXRfKC0rEicAn2JQ0yWn+MxgyXlEwXG3Ul11MqC+F0hPeW8cm5uZL/A==", - "requires": { - "@firebase/component": "0.1.0", - "@firebase/installations": "0.3.7", - "@firebase/logger": "0.1.32", - "@firebase/performance-types": "0.0.7", - "@firebase/util": "0.2.35", + "version": "0.2.28", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.2.28.tgz", + "integrity": "sha512-A9hCz4MFvs081atOfvtAu6YV2MMrx758DzNZrHaMHJCeLPQFPy1zRQ+zZzdV/bsktVNYhUatVo/1G8jLscBUQQ==", + "requires": { + "@firebase/component": "0.1.1", + "@firebase/installations": "0.3.8", + "@firebase/logger": "0.1.33", + "@firebase/performance-types": "0.0.8", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/performance-types": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.0.7.tgz", - "integrity": "sha512-FElDfwFO6ucSH6acHiHMcLrJdOCUBcs2XnqnoOCJ/XGvORuJRCl7kEiKS6DPsZwvBelp0jZLwHmmTYSm5dpJMQ==" + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.0.8.tgz", + "integrity": "sha512-3RK15Bct9PRdr0YBdbZV2KTi5yrPzscJVEsdnsLHuwXBntqlQaouQqwlCNFn25dtCMY0cgV/yiaFmuo13mbJ8A==" }, "@firebase/polyfill": { - "version": "0.3.29", - "resolved": "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.29.tgz", - "integrity": "sha512-Ogc6BUYoyOb64lFAGBjMydoczSHdazMeINTBjEEfSkaDqOi7l/tgk9X+oWYe5mxfPNrdBLREkfQb6oKqFPqydQ==", + "version": "0.3.30", + "resolved": "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.30.tgz", + "integrity": "sha512-ewYLN+CWiLTsLj0LFXLvdEKIaM1PJtoot2FoQ8VSYqYXbwahHCRwcmLRtgvHpR7bvIYPs9HYx8aBK0GrMP3bNg==", "requires": { - "core-js": "3.4.1", + "core-js": "3.4.8", "promise-polyfill": "8.1.3", "whatwg-fetch": "2.0.4" }, @@ -2030,51 +2030,51 @@ } }, "@firebase/remote-config": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.1.8.tgz", - "integrity": "sha512-E5h715SxHSosugzbVCh0+qOCXpFoBYRvZHyesjPm+NZ8XU+v0jsdusG6jcoMLEdftt50IYamta6HvdP+oQj2gw==", - "requires": { - "@firebase/component": "0.1.0", - "@firebase/installations": "0.3.7", - "@firebase/logger": "0.1.32", - "@firebase/remote-config-types": "0.1.4", - "@firebase/util": "0.2.35", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.1.9.tgz", + "integrity": "sha512-s51iqMkmietpi8eSWuP6RKNdi3pDfIV3QFOgGQIe/0yCqGYQJTKpB5ZhigT3x7Goy/yXfU8GexJV0r8sNrkWQg==", + "requires": { + "@firebase/component": "0.1.1", + "@firebase/installations": "0.3.8", + "@firebase/logger": "0.1.33", + "@firebase/remote-config-types": "0.1.5", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/remote-config-types": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.1.4.tgz", - "integrity": "sha512-GFnfuSomjMOE2ik4TD1DuhfswsWr7UEu9+zSvKgDKslTFQ35L2rPqJEExTfHuL1uVVkYF6k8wEyGw0zwIkaeBQ==" + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.1.5.tgz", + "integrity": "sha512-1JR0XGVN0dNKJlu5sMYh0qL0jC85xNgXfUquUGNHhy9lH3++t1gD91MeiDBgxI73oFQR7PEPeu+CTeDS0g8lWQ==" }, "@firebase/storage": { - "version": "0.3.21", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.3.21.tgz", - "integrity": "sha512-WSBMorw/8j6ezRfhCQ0V4qTGA9mSowXUvOZ1CnNs/MCYUqJ5I3w96E7uEg38EgZgSYwf13J1jiYBlta2Q9UfZw==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.3.22.tgz", + "integrity": "sha512-Xy4TOzWlQVEoucv/8SPoKKq/qnYOuB54AisYqkoZs2DqjBQn3Wsdo56mkLikNVr6/fnmWs8jlmjtbcP2baUkOg==", "requires": { - "@firebase/component": "0.1.0", - "@firebase/storage-types": "0.3.7", - "@firebase/util": "0.2.35", + "@firebase/component": "0.1.1", + "@firebase/storage-types": "0.3.8", + "@firebase/util": "0.2.36", "tslib": "1.10.0" } }, "@firebase/storage-types": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.3.7.tgz", - "integrity": "sha512-7HnR4r7bffV7LJwIAmZIKyvEdEBm6eEx8k9SeWNxbQK5nev+KoGrYLpkKTgWsv1BRc9EC+RH4l75zZMGB7KJGw==" + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.3.8.tgz", + "integrity": "sha512-F0ED2WZaGjhjEdOk85c/1ikDQdWM1NiATFuTmRsaGYZyoERiwh/Mr6FnjqnLIeiJZqa6v2hk/aUgKosXjMWH/Q==" }, "@firebase/util": { - "version": "0.2.35", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.35.tgz", - "integrity": "sha512-uixPxpdwxP8ATFVmgr3oz82VZovxJqyK6m2oFvZ+0GLY5VlWa37NLfOXWbcBa5QeqX0Ox46Z7/OaE8WfpAlPAA==", + "version": "0.2.36", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.36.tgz", + "integrity": "sha512-AqrXca+8rMbPyp7zMO9BoZrdbb8wsT5kmqwge9QW4ZBxTTSQrvBs7VylGx5Ede4VbhqRJvkmo7G73/dp2L+wbA==", "requires": { "tslib": "1.10.0" } }, "@firebase/webchannel-wrapper": { - "version": "0.2.33", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.33.tgz", - "integrity": "sha512-xfYZ1Z2CY7YRUJzXRS+nR1HKhxmGItdmGl7SmhhpuX89MXiTP9zjoa65asdSwDwTfCK8vALvya5pl2ecbQAZQg==" + "version": "0.2.34", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.34.tgz", + "integrity": "sha512-XCADVD5kirtoFtqZbsPMAvXdDg1gJJgzQufOt7g93YaEDIZoyKOi0dupmSzf0iQ1yzdTY1ntQz3Si0i9eac8WQ==" }, "@formatjs/intl-listformat": { "version": "1.3.1", @@ -2227,9 +2227,9 @@ } }, "@grpc/grpc-js": { - "version": "0.6.13", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.13.tgz", - "integrity": "sha512-fxkxS+sEtYdfR0ifqgCTqBe4jZ5PvlvgcaYpzwgMqz+b18uUdPmp5eRQN+qbbJg2ZMUcgItA8OWIvAobW3PDng==", + "version": "0.6.14", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.14.tgz", + "integrity": "sha512-M6q3MtHzk0NQPs1PB+SXSJtkDtK8WXJh+1B1WVJQp5HTURadzj9t1bUb/Fjhq+K57lKsOgL60r8WGmE7vks1eg==", "optional": true, "requires": { "semver": "^6.2.0" @@ -2523,9 +2523,9 @@ } }, "@material-ui/core": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.7.2.tgz", - "integrity": "sha512-ZbeO6xshTEHcMU2jMNjBY26u9p5ILQFj0y7HvOPZ9WT6POaN6qNKYX2PdXnnRDE1MpN8W2K1cxM4KKkiYWNkCQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.8.0.tgz", + "integrity": "sha512-ODyvWlDOP0D3tU32wVlYRNrdS+LeJxB3xJbXdDxq6gnG4JhKk79+ylP0cImjPBI2yEZw0hcYHWFZOGD+0R1X4g==", "requires": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.7.1", @@ -2602,6 +2602,17 @@ "integrity": "sha512-AN+GZNXytX9yxGi0JOfxHrRTbhFybjUJ05rnsBVjcB+16e466Z0Xe5IxawuOayVZgTBNDxmPKo5j4V6OnMtaSQ==", "requires": { "@types/react": "*" + }, + "dependencies": { + "@types/react": { + "version": "16.9.16", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", + "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + } } }, "@material-ui/utils": { @@ -3920,9 +3931,9 @@ "dev": true }, "@testing-library/dom": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-6.10.1.tgz", - "integrity": "sha512-5BPKxaO+zSJDUbVZBRNf9KrmDkm/EcjjaHSg3F9+031VZyPACKXlwLBjVzZxheunT9m72DoIq7WvyE457/Xweg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-6.11.0.tgz", + "integrity": "sha512-Pkx9LMIGshyNbfmecjt18rrAp/ayMqGH674jYER0SXj0iG9xZc+zWRjk2Pg9JgPBDvwI//xGrI/oOQkAi4YEew==", "dev": true, "requires": { "@babel/runtime": "^7.6.2", @@ -3958,9 +3969,9 @@ } }, "@types/babel__generator": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.0.tgz", - "integrity": "sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz", + "integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==", "dev": true, "requires": { "@babel/types": "^7.0.0" @@ -4093,6 +4104,17 @@ "requires": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" + }, + "dependencies": { + "@types/react": { + "version": "16.9.16", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", + "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + } } }, "@types/invariant": { @@ -4169,9 +4191,9 @@ "dev": true }, "@types/node": { - "version": "12.12.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz", - "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==" + "version": "12.12.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz", + "integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -4204,6 +4226,7 @@ "version": "16.9.15", "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.15.tgz", "integrity": "sha512-WsmM1b6xQn1tG3X2Hx4F3bZwc2E82pJXt5OPs2YJgg71IzvUoKOSSSYOvLXYCg1ttipM+UuA4Lj3sfvqjVxyZw==", + "dev": true, "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4254,6 +4277,17 @@ "integrity": "sha512-Hk8jiuT7iLOHrcjKP/ZVSyCNXK73wJAUz60xm0mVhiRujrdiI++j4duLiL282VGxwAgxetHQFfqA29LgEeSkFA==", "requires": { "@types/react": "*" + }, + "dependencies": { + "@types/react": { + "version": "16.9.16", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", + "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + } } }, "@types/resolve": { @@ -4304,6 +4338,17 @@ "integrity": "sha512-Yjye9VwMdYeXfS71ihueWRSxrruuXTwKCbzue4+5b2rjnQ//AtyM7myZ1BEhNhBQ/nL/RE7bdToUoLln2miKvg==", "requires": { "@types/react": "*" + }, + "dependencies": { + "@types/react": { + "version": "16.9.16", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", + "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + } } }, "@types/testing-library__dom": { @@ -4370,16 +4415,68 @@ "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "tsutils": "^3.17.1" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", + "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.10.0", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", + "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "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, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@typescript-eslint/experimental-utils": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", - "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.11.0.tgz", + "integrity": "sha512-YxcA/y0ZJaCc/fB/MClhcDxHI0nOBB7v2/WxBju2cOTanX7jO9ttQq6Fy4yW9UaY5bPd9xL3cun3lDVqk67sPQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.10.0", + "@typescript-eslint/typescript-estree": "2.11.0", "eslint-scope": "^5.0.0" } }, @@ -4393,12 +4490,64 @@ "@typescript-eslint/experimental-utils": "2.10.0", "@typescript-eslint/typescript-estree": "2.10.0", "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", + "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.10.0", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", + "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "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, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@typescript-eslint/typescript-estree": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", - "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.11.0.tgz", + "integrity": "sha512-HGY4+d4MagO6cKMcKfIKaTMxcAv7dEVnji2Zi+vi5VV8uWAM631KjAB5GxFcexMYrwKT0EekRiiGK1/Sd7VFGA==", "dev": true, "requires": { "debug": "^4.1.1", @@ -4904,13 +5053,13 @@ "dev": true }, "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.0.tgz", + "integrity": "sha512-ONOEQoKrvXPKk7Su92Co0YMqYO32FfqJTzkKU9u2UpIXyYZIzLSvpdg4AwvSw4mSUW0czu6inK+zby6Oj6gDjQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.0" } }, "array-union": { @@ -4933,14 +5082,13 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.2.tgz", - "integrity": "sha512-VXjh7lAL4KXKF2hY4FnEW9eRW6IhdvFW1sN/JwLbmECbCgACCnBHNyP3lFiYuttr0jxRN9Bsc5+G27dMseSWqQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.15.0", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.0-next.1" } }, "arrify": { @@ -5538,6 +5686,16 @@ "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", @@ -6800,14 +6958,14 @@ } }, "core-js": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.1.tgz", - "integrity": "sha512-KX/dnuY/J8FtEwbnrzmAjUYgLqtk+cxM86hfG60LGiW3MmltIc2yAmDgBgEkfm0blZhUrdr1Zd84J2Y14mLxzg==" + "version": "3.4.8", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.8.tgz", + "integrity": "sha512-b+BBmCZmVgho8KnBUOXpvlqEMguko+0P+kXCwD4vIprsXC6ht1qgPxtb1OK6XgSlrySF71wkwBQ0Hv695bk9gQ==" }, "core-js-compat": { - "version": "3.4.8", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.4.8.tgz", - "integrity": "sha512-l3WTmnXHV2Sfu5VuD7EHE2w7y+K68+kULKt5RJg8ZJk3YhHF1qLD4O8v8AmNq+8vbOwnPFFDvds25/AoEvMqlQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.5.0.tgz", + "integrity": "sha512-E7iJB72svRjJTnm9HDvujzNVMCm3ZcDYEedkJ/sDTNsy/0yooCd9Cg7GSzE7b4e0LfIkjijdB1tqg0pGwxWeWg==", "dev": true, "requires": { "browserslist": "^4.8.2", @@ -6815,9 +6973,9 @@ } }, "core-js-pure": { - "version": "3.4.8", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.4.8.tgz", - "integrity": "sha512-K9iPNbLDZ0Epojwd8J3lhodmrLHYvxb07H3DaFme1ne4TIlFq/ufiyPC40rc3OX6NCaVa0zaSu+VV6BVDR2wiA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.5.0.tgz", + "integrity": "sha512-wB0QtKAofWigiISuT1Tej3hKgq932fB//Lf1VoPbiLpTYlHY0nIDhgF+q1na0DAKFHH5wGCirkAknOmDN8ijXA==", "dev": true }, "core-util-is": { @@ -7460,9 +7618,9 @@ } }, "date-and-time": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.11.0.tgz", - "integrity": "sha512-VyzhHurex4wlg9oMszn7O+kxHchphWjzDn7Mv0WfkFKI6hSNOQePpTBFGsnRakvLNzQKXqPBAVV8DOxUGtUxqA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.11.1.tgz", + "integrity": "sha512-+1JkWME+UWRpCfvE1T0Vfbw629Ego0IcfHH0qtP4KhAXs7IJT2qsg1hNePqZhyD8Wby46HlW393lSL5PZSzDsA==", "optional": true }, "date-fns": { @@ -8059,10 +8217,9 @@ } }, "es-abstract": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.3.tgz", - "integrity": "sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw==", - "dev": true, + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -8072,6 +8229,7 @@ "is-regex": "^1.0.4", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", + "object.assign": "^4.1.0", "string.prototype.trimleft": "^2.1.0", "string.prototype.trimright": "^2.1.0" } @@ -8080,7 +8238,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -9177,6 +9334,13 @@ "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.2.tgz", "integrity": "sha512-Wz3c3XQ5xroCxd1G8b7yL0Ehkf0TC9oYC6buPFkNnU9EnaPlifeAFCyCh+iewXTyFRcg0a6j3J7FmJsIhlhBdw==" }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "filesize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-4.2.1.tgz", @@ -9269,24 +9433,24 @@ } }, "firebase": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.5.2.tgz", - "integrity": "sha512-G1hJ59CoV/gdNulBAFKiGD8EIDKCeQS16tc3TQ/sBCb87urDuaYKv7/n/CgK8llSt+pWJjPc6U0F223zt0OdKA==", - "requires": { - "@firebase/analytics": "0.2.8", - "@firebase/app": "0.4.26", - "@firebase/app-types": "0.4.9", - "@firebase/auth": "0.13.2", - "@firebase/database": "0.5.15", - "@firebase/firestore": "1.8.1", - "@firebase/functions": "0.4.27", - "@firebase/installations": "0.3.7", - "@firebase/messaging": "0.5.8", - "@firebase/performance": "0.2.27", - "@firebase/polyfill": "0.3.29", - "@firebase/remote-config": "0.1.8", - "@firebase/storage": "0.3.21", - "@firebase/util": "0.2.35" + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.6.0.tgz", + "integrity": "sha512-4hjPrcNDF3E3vvoe+IDcnxu+Z4w7xxDBHZAmLjTAPPmtc8Ifb6vJ99tESGIb0Ncx+5Bl1nZK9um6qTf9fgGtqA==", + "requires": { + "@firebase/analytics": "0.2.9", + "@firebase/app": "0.5.0", + "@firebase/app-types": "0.5.0", + "@firebase/auth": "0.13.3", + "@firebase/database": "0.5.16", + "@firebase/firestore": "1.9.0", + "@firebase/functions": "0.4.28", + "@firebase/installations": "0.3.8", + "@firebase/messaging": "0.6.0", + "@firebase/performance": "0.2.28", + "@firebase/polyfill": "0.3.30", + "@firebase/remote-config": "0.1.9", + "@firebase/storage": "0.3.22", + "@firebase/util": "0.2.36" } }, "firebase-admin": { @@ -9575,14 +9739,15 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", + "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" + "node-pre-gyp": "*" }, "dependencies": { "abbrev": { @@ -9630,7 +9795,7 @@ } }, "chownr": { - "version": "1.1.1", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true @@ -9660,7 +9825,7 @@ "optional": true }, "debug": { - "version": "4.1.1", + "version": "3.2.6", "bundled": true, "dev": true, "optional": true, @@ -9687,12 +9852,12 @@ "optional": true }, "fs-minipass": { - "version": "1.2.5", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs.realpath": { @@ -9718,7 +9883,7 @@ } }, "glob": { - "version": "7.1.3", + "version": "7.1.6", "bundled": true, "dev": true, "optional": true, @@ -9747,7 +9912,7 @@ } }, "ignore-walk": { - "version": "3.0.1", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true, @@ -9766,7 +9931,7 @@ } }, "inherits": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true, "dev": true, "optional": true @@ -9808,7 +9973,7 @@ "optional": true }, "minipass": { - "version": "2.3.5", + "version": "2.9.0", "bundled": true, "dev": true, "optional": true, @@ -9818,12 +9983,12 @@ } }, "minizlib": { - "version": "1.2.1", + "version": "1.3.3", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mkdirp": { @@ -9836,24 +10001,24 @@ } }, "ms": { - "version": "2.1.1", + "version": "2.1.2", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.3.0", + "version": "2.4.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^4.1.0", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.12.0", + "version": "0.14.0", "bundled": true, "dev": true, "optional": true, @@ -9867,7 +10032,7 @@ "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", - "tar": "^4" + "tar": "^4.4.2" } }, "nopt": { @@ -9881,13 +10046,22 @@ } }, "npm-bundled": { - "version": "1.0.6", + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.4.1", + "version": "1.4.7", "bundled": true, "dev": true, "optional": true, @@ -9958,7 +10132,7 @@ "optional": true }, "process-nextick-args": { - "version": "2.0.0", + "version": "2.0.1", "bundled": true, "dev": true, "optional": true @@ -9999,7 +10173,7 @@ } }, "rimraf": { - "version": "2.6.3", + "version": "2.7.1", "bundled": true, "dev": true, "optional": true, @@ -10026,7 +10200,7 @@ "optional": true }, "semver": { - "version": "5.7.0", + "version": "5.7.1", "bundled": true, "dev": true, "optional": true @@ -10079,18 +10253,18 @@ "optional": true }, "tar": { - "version": "4.4.8", + "version": "4.4.13", "bundled": true, "dev": true, "optional": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" } }, "util-deprecate": { @@ -10115,7 +10289,7 @@ "optional": true }, "yallist": { - "version": "3.0.3", + "version": "3.1.1", "bundled": true, "dev": true, "optional": true @@ -10160,9 +10334,9 @@ } }, "gcp-metadata": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.2.tgz", - "integrity": "sha512-vR7kcJMCYJG/mYWp/a1OszdOqnLB/XW1GorWW1hc1lWVNL26L497zypWb9cG0CYDQ4Bl1Wk0+fSZFFjwJlTQgQ==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.3.tgz", + "integrity": "sha512-6C/lE8rQY0zBsfTobc0OtNLNwQZmJ9d1uy+snawT2V0MN9V8KsbncNVZJxIrdrV5xuDRi0x0ppzBuUHzA22oAA==", "optional": true, "requires": { "gaxios": "^2.1.0", @@ -10401,9 +10575,9 @@ } }, "google-auth-library": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.6.1.tgz", - "integrity": "sha512-qPbg/KxZao9DxPcvP9QmKFjHJGdqsJb4PTcbPl8QcHtbzukXhSKNAt+ErfizAn80MuzReBPihsrMQhgfGqirdw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.7.0.tgz", + "integrity": "sha512-uclMldsQNf64Qr67O8TINdnqbU/Ixv81WryX+sF9g7uP0igJ98aCR/uU399u1ABLa53LNsyji+bo+bP8/iL9dA==", "optional": true, "requires": { "arrify": "^2.0.0", @@ -10417,9 +10591,9 @@ } }, "google-gax": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.11.2.tgz", - "integrity": "sha512-NWdIenM/F/SLIaQLBP5Fxsva+vgZ38sO9KR/Vj36APQceTzAVimn7i0jYUrxBv77uov4xZzwcORzTuqp0eE4WQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.12.0.tgz", + "integrity": "sha512-BeeoxVO6y9K20gUsexUwptutd0PfrTItrA02JWwwstlBIOAcvgFp86MHWufQsnrkPVhxBjHXq65aIkSejtJjDg==", "optional": true, "requires": { "@grpc/grpc-js": "^0.6.12", @@ -11017,8 +11191,7 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, "has-value": { "version": "1.0.0", @@ -11852,8 +12025,7 @@ "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" }, "is-ci": { "version": "1.2.1", @@ -12120,7 +12292,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, "requires": { "has-symbols": "^1.0.1" } @@ -14461,9 +14632,9 @@ } }, "mobx": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.0.tgz", - "integrity": "sha512-Ax7vE32zBRgO0A3Yu12RXaFwIhBzpGQXZjRHiDvKLrqpDEijhNTSuXJ1Ci+L30BSa/Mb3by9+3nuKq15YoH5dA==" + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.1.tgz", + "integrity": "sha512-o4aN0GqKcDmKwu2wVsqbujU4F63ZvmbBLSc7WhzuAu9S9eF2wgNjqIkzrb/kbY3C9/mGYG4k1M0KbCuG1GJ7IQ==" }, "mobx-react-lite": { "version": "1.5.1", @@ -14471,9 +14642,9 @@ "integrity": "sha512-40Gn8hFq+MuNHqCaeSo2adN4WvpWkIeSYZVJWzRzm0rbEf0BFow6Ir9IefErql0pX9q650TN1JAQXvrXxKR8Mg==" }, "mobx-react-router": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/mobx-react-router/-/mobx-react-router-4.0.7.tgz", - "integrity": "sha512-x7eza70EimFyvF0VPyj5X2MYo9jksy61UVwz5ERXWnXVE911XRTL/V2kXiX7fvVtMHzp5m2q/kxBoti9uNixEw==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mobx-react-router/-/mobx-react-router-4.1.0.tgz", + "integrity": "sha512-2knsbDqVorWLngZWbdO8tr7xcZXaLpVFsFlCaGaoyZ+EP9erVGRxnlWGqKyFObs3EH1JPLyTDOJ2LPTxb/lB6Q==" }, "moment": { "version": "2.24.0", @@ -14868,8 +15039,7 @@ "object-inspect": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", - "dev": true + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" }, "object-is": { "version": "1.0.1", @@ -14894,7 +15064,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -14903,37 +15072,37 @@ } }, "object.entries": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", - "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", + "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } }, "object.fromentries": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.1.tgz", - "integrity": "sha512-PUQv8Hbg3j2QX0IQYv3iAGCbGcu4yY4KQ92/dhA4sFSixBmSmp13UpDLs6jGK8rBtbmhNNIK99LD2k293jpiGA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", + "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.15.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } }, "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "object.pick": { @@ -14946,13 +15115,13 @@ } }, "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } @@ -16385,9 +16554,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==" + "version": "10.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.9.tgz", + "integrity": "sha512-+6VygF9LbG7Gaqeog2G7u1+RUcmo0q1rI+2ZxdIg2fAUngk5Vz9fOCHXdloNUOHEPd1EuuOpL5O0CdgN9Fx5UQ==" } } }, @@ -16921,11 +17090,12 @@ } }, "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", "requires": { - "define-properties": "^1.1.2" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "regexpp": { @@ -16955,9 +17125,9 @@ "dev": true }, "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.1.tgz", + "integrity": "sha512-7LutE94sz/NKSYegK+/4E77+8DipxF+Qn2Tmu362AcmsF2NYq/wx3+ObvU90TKEhjf7hQoFXo23ajjrXP7eUgg==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -17397,9 +17567,9 @@ }, "dependencies": { "find-cache-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.1.0.tgz", - "integrity": "sha512-zw+EFiNBNPgI2NTrKkDd1xd7q0cs6wr/iWnr/oUkI0yF9K9GqQ+riIt4aiyFaaqpaWbxPrJXHI+QvmNUQbX+0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", + "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", "dev": true, "requires": { "commondir": "^1.0.1", @@ -18480,9 +18650,9 @@ } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" }, "stream-to-observable": { "version": "0.1.0", @@ -18545,21 +18715,19 @@ } }, "string.prototype.padend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", - "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.0.tgz", + "integrity": "sha512-3aIv8Ffdp8EZj8iLwREGpQaUZiPyrWrpzMBHvkiSW/bK/EGve9np07Vwy7IJ5waydpGXzQZu/F8Oze2/IWkBaA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.4.3", - "function-bind": "^1.0.2" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "string.prototype.trimleft": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", - "dev": true, "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" @@ -18569,7 +18737,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", - "dev": true, "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" @@ -18892,16 +19059,16 @@ } }, "terser-webpack-plugin": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.2.tgz", - "integrity": "sha512-fdEb91kR2l+BVgES77N/NTXWZlpX6vX+pYPjnX5grcDYBF2CMnzJiXX4NNlna4l04lvCW39lZ+O/jSvUhHH/ew==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", + "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", "dev": true, "requires": { "cacache": "^12.0.2", "find-cache-dir": "^2.1.0", "is-wsl": "^1.1.0", "schema-utils": "^1.0.0", - "serialize-javascript": "^2.1.1", + "serialize-javascript": "^2.1.2", "source-map": "^0.6.1", "terser": "^4.1.2", "webpack-sources": "^1.4.0", @@ -18932,9 +19099,9 @@ } }, "serialize-javascript": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.1.tgz", - "integrity": "sha512-MPLPRpD4FNqWq9tTIjYG5LesFouDhdyH0EPY3gVK4DRD5+g4aDqdNSzLIwceulo3Yj+PL1bPh6laE5+H6LTcrQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", "dev": true }, "source-map": { @@ -19362,12 +19529,12 @@ } }, "tsoa": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/tsoa/-/tsoa-2.5.9.tgz", - "integrity": "sha512-HQAjfcPmd4OFM26eLuslJG6B4doUPIUoHzHHGnEGe2SMJlPbj13sxDX0b0l5K0VXT+tbFBbyQUsH02jz/jQi5w==", + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/tsoa/-/tsoa-2.5.10.tgz", + "integrity": "sha512-Qd1jJ2lbC1PiuqxTCPysL/y+LmWozO+S7YDqnLWCYOuBbFrAcfsSLA2G9yveTjp/EdqwgTyBydDwfYTDb0qk0g==", "requires": { "fs-extra": "^8.1.0", - "handlebars": "^4.1.2", + "handlebars": "^4.5.3", "merge": "^1.2.1", "minimatch": "^3.0.4", "moment": "^2.24.0", From b3d759a0b4c9f8a85244030dcc0487b0e8808416 Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 10:12:22 +0300 Subject: [PATCH 5/9] fix: lint front mistakes --- apps/js-machine-front/src/app/App.tsx | 2 +- .../src/app/components/styles/snowflakesMedia.css | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/js-machine-front/src/app/App.tsx b/apps/js-machine-front/src/app/App.tsx index 430403e..c4ffadc 100644 --- a/apps/js-machine-front/src/app/App.tsx +++ b/apps/js-machine-front/src/app/App.tsx @@ -1,4 +1,4 @@ -import React, { memo, useMemo } from 'react'; +import React, { useMemo } from 'react'; import './firebase.conf'; import { theme } from './theme'; diff --git a/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css b/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css index de527a7..67cbc86 100644 --- a/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css +++ b/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css @@ -1,21 +1,21 @@ @media screen and (min-width: 960px) { .snow-switcher { - top: 27px; - left: 28px; + top: 29px; + left: 38px; } } @media screen and (max-width: 959px) { .snow-switcher { - top: 14px; - left: 18px; + top: 18px; + left: 24px; } } @media screen and (max-width: 600px) { .snow-switcher { top: 0px; - left: 0px; + left: -4px; flex-direction: row-reverse; } } @@ -23,7 +23,6 @@ @media screen and (max-width: 600px) and (orientation: landscape) { .snow-switcher { top: -2px; - left: -4px; } .snow-switcher__label { From 9ad38e4bfe5a50ac61e0132c0a1ee3baf7e06e00 Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 15 Dec 2019 10:45:57 +0300 Subject: [PATCH 6/9] fix: minor fixes --- .../src/app/components/Snowflakes.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index eb13c33..828da3e 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -47,7 +47,7 @@ export function Snowflakes() { return; } - const flakesAmoung = getFlakesAmoungByWindowSize(); + const flakesAmoung = getFlakesAmoungByScreenWidth(window.innerWidth); const flakes: Snowflake[] = createSnowflakes(flakesAmoung); window.addEventListener("resize", function () { @@ -57,8 +57,7 @@ export function Snowflakes() { snowStep(); - function getFlakesAmoungByWindowSize() { - const width = window.innerWidth; + function getFlakesAmoungByScreenWidth(width: number) { if (width < 500) { return (60); } else if (width < 750) { @@ -134,10 +133,12 @@ export function Snowflakes() { }; } + const MAIN_YELLOW = '#F2E14C'; + const useStyles = makeStyles({ colorSecondary: { '&$checked': { - color: '#f2e14c', + color: MAIN_YELLOW, }, }, switchBase: { @@ -145,7 +146,7 @@ export function Snowflakes() { '&$checked': { color: 'white', '& + $track': { - backgroundColor: '#f2e14c', + backgroundColor: MAIN_YELLOW, opacity: 1, }, "&:hover": { From 1ff117480968ed7da057b25032c73c17e29ed657 Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Fri, 20 Dec 2019 17:32:12 +0300 Subject: [PATCH 7/9] (fix) snowflake logic encapsulated --- .../src/app/components/Snowflakes.tsx | 131 +------ .../{ => hooks}/models/Snowflake.tsx | 0 .../app/components/hooks/useSnowflakes.tsx | 136 +++++++ package-lock.json | 365 +++++++----------- 4 files changed, 279 insertions(+), 353 deletions(-) rename apps/js-machine-front/src/app/components/{ => hooks}/models/Snowflake.tsx (100%) create mode 100644 apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index 828da3e..741ff55 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -1,137 +1,16 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import './styles/snowflakes.css'; import './styles/snowflakesMedia.css'; -import { Snowflake } from './models/Snowflake'; import Switch from '@material-ui/core/Switch'; import { makeStyles } from '@material-ui/core/styles'; -export function Snowflakes() { - - const [isSnowing, setSnowing] = useState(true); - const requestId = React.useRef(0); - - useEffect(() => { - startSnowflakes(); - }); - - const getCanvasElementById = (id: string): HTMLCanvasElement => { - const canvas = document.getElementById(id); - - if (!(canvas instanceof HTMLCanvasElement)) { - throw new Error(`The element of id "${id}" is not a HTMLCanvasElement. Make sure a element is present in the document.`); - } - - return canvas; - }; - - const getCanvasRenderingContext2D = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => { - const context = canvas.getContext('2d'); - - if (!(context instanceof CanvasRenderingContext2D)) { - throw new Error('This browser does not support 2-dimensional canvas rendering contexts.'); - } - - return context; - }; - - function startSnowflakes() { - - const canvas: HTMLCanvasElement = getCanvasElementById('snow'); - const ctx: CanvasRenderingContext2D = getCanvasRenderingContext2D(canvas); - - if (!isSnowing) { - window.cancelAnimationFrame(requestId.current); - ctx.clearRect(0, 0, canvas.width, canvas.height); - return; - } - - const flakesAmoung = getFlakesAmoungByScreenWidth(window.innerWidth); - const flakes: Snowflake[] = createSnowflakes(flakesAmoung); - - window.addEventListener("resize", function () { - canvas.width = window.innerWidth; - canvas.height = window.innerHeight; - }); +import { useSnowflakes } from './hooks/useSnowflakes'; - snowStep(); - - function getFlakesAmoungByScreenWidth(width: number) { - if (width < 500) { - return (60); - } else if (width < 750) { - return (80); - } else if (width < 1000) { - return (100); - } else if (width < 1200) { - return (120); - } else if (width < 1600) { - return (160); - } else { - return (180); - } - } - - function snowStep() { - ctx.clearRect(0, 0, canvas.width, canvas.height); - for (let i = 0; i < flakes.length; i++) { - const flake: Snowflake = flakes[i]; - - flake.speedX *= .98; - flake.speedX += Math.cos(flake.step += .05) * flake.stepSize; - - flake.y += flake.speedY; - flake.x += flake.speedX; - - if (flake.y >= canvas.height || flake.y <= 0) { - reset(flake); - } - - if (flake.x >= canvas.width || flake.x <= 0) { - reset(flake); - } - - ctx.beginPath(); - ctx.fillStyle = "rgba(255,255,255," + flake.opacity + ")"; - ctx.arc(flake.x, flake.y, flake.size, 0, Math.PI * 2); - ctx.fill(); - } - requestId.current = requestAnimationFrame(snowStep); - }; - - function reset(flake: Snowflake) { - flake.x = Math.floor(Math.random() * canvas.width); - flake.y = 0; - flake.size = (Math.random() * 3) + 2; - flake.speedY = (Math.random() * 1) + 0.5; - flake.speedX = 0; - flake.opacity = (Math.random() * 0.5) + 0.3; - } - - function createSnowflakes(flakeCount: number): Snowflake[] { - const flakes: Snowflake[] = []; - for (let i = 0; i < flakeCount; i++) { - const x = Math.floor(Math.random() * canvas.width), - y = Math.floor(Math.random() * canvas.height), - size = (Math.random() * 3) + 2, - speedY = (Math.random() * 1) + 0.5, - opacity = (Math.random() * 0.5) + 0.3; +export function Snowflakes() { - flakes.push({ - speedY: speedY, - speedX: 0, - x: x, - y: y, - size: size, - stepSize: (Math.random()) / 30, - step: 0, - opacity: opacity, - }); - } - return flakes; - }; - } + const {isSnowing, handleSnowSwitch} = useSnowflakes(); const MAIN_YELLOW = '#F2E14C'; @@ -169,7 +48,7 @@ export function Snowflakes() { size='small' checked={isSnowing} value={isSnowing} - onClick={() => setSnowing(!isSnowing)}> + onClick={handleSnowSwitch}> diff --git a/apps/js-machine-front/src/app/components/models/Snowflake.tsx b/apps/js-machine-front/src/app/components/hooks/models/Snowflake.tsx similarity index 100% rename from apps/js-machine-front/src/app/components/models/Snowflake.tsx rename to apps/js-machine-front/src/app/components/hooks/models/Snowflake.tsx diff --git a/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx b/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx new file mode 100644 index 0000000..cacd60c --- /dev/null +++ b/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx @@ -0,0 +1,136 @@ +import React, { useEffect, useState, useCallback } from 'react'; + +import { Snowflake } from './models/Snowflake'; + +export function useSnowflakes() { + + const [isSnowing, setSnowing] = useState(true); + const requestId = React.useRef(0); + + useEffect(() => { + startSnowflakes(); + }); + + const handleSnowSwitch = useCallback(() => { + setSnowing(!isSnowing); + }, [isSnowing]); + + const getCanvasElementById = useCallback((id: string): HTMLCanvasElement => { + const canvas = document.getElementById(id); + + if (!(canvas instanceof HTMLCanvasElement)) { + throw new Error(`The element of id "${id}" is not a HTMLCanvasElement. Make sure a element is present in the document.`); + } + + return canvas; + }, []); + + const getCanvasRenderingContext2D = useCallback((canvas: HTMLCanvasElement): CanvasRenderingContext2D => { + const context = canvas.getContext('2d'); + + if (!(context instanceof CanvasRenderingContext2D)) { + throw new Error('This browser does not support 2-dimensional canvas rendering contexts.'); + } + + return context; + }, []); + + const startSnowflakes = useCallback( () => { + + const canvas: HTMLCanvasElement = getCanvasElementById('snow'); + const ctx: CanvasRenderingContext2D = getCanvasRenderingContext2D(canvas); + + if (!isSnowing) { + window.cancelAnimationFrame(requestId.current); + ctx.clearRect(0, 0, canvas.width, canvas.height); + return; + } + + const flakesAmoung = getFlakesAmoungByScreenWidth(window.innerWidth); + const flakes: Snowflake[] = createSnowflakes(flakesAmoung); + + window.addEventListener("resize", function () { + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + }); + + snowStep(); + + function getFlakesAmoungByScreenWidth(width: number) { + if (width < 500) { + return (60); + } else if (width < 750) { + return (80); + } else if (width < 1000) { + return (100); + } else if (width < 1200) { + return (120); + } else if (width < 1600) { + return (160); + } else { + return (180); + } + } + + function snowStep() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + for (let i = 0; i < flakes.length; i++) { + const flake: Snowflake = flakes[i]; + + flake.speedX *= .98; + flake.speedX += Math.cos(flake.step += .05) * flake.stepSize; + + flake.y += flake.speedY; + flake.x += flake.speedX; + + if (flake.y >= canvas.height || flake.y <= 0) { + reset(flake); + } + + if (flake.x >= canvas.width || flake.x <= 0) { + reset(flake); + } + + ctx.beginPath(); + ctx.fillStyle = "rgba(255,255,255," + flake.opacity + ")"; + ctx.arc(flake.x, flake.y, flake.size, 0, Math.PI * 2); + ctx.fill(); + } + requestId.current = requestAnimationFrame(snowStep); + }; + + function reset(flake: Snowflake) { + flake.x = Math.floor(Math.random() * canvas.width); + flake.y = 0; + flake.size = (Math.random() * 3) + 2; + flake.speedY = (Math.random() * 1) + 0.5; + flake.speedX = 0; + flake.opacity = (Math.random() * 0.5) + 0.3; + } + + function createSnowflakes(flakeCount: number): Snowflake[] { + const flakes: Snowflake[] = []; + for (let i = 0; i < flakeCount; i++) { + const x = Math.floor(Math.random() * canvas.width), + y = Math.floor(Math.random() * canvas.height), + size = (Math.random() * 3) + 2, + speedY = (Math.random() * 1) + 0.5, + opacity = (Math.random() * 0.5) + 0.3; + + flakes.push({ + speedY: speedY, + speedX: 0, + x: x, + y: y, + size: size, + stepSize: (Math.random()) / 30, + step: 0, + opacity: opacity, + }); + } + return flakes; + }; + }, [isSnowing]); + + return {isSnowing, handleSnowSwitch}; +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cedee6f..3ab4e02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -297,15 +297,15 @@ } }, "@babel/core": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.5.tgz", - "integrity": "sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", + "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", + "@babel/generator": "^7.7.7", "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.5", + "@babel/parser": "^7.7.7", "@babel/template": "^7.7.4", "@babel/traverse": "^7.7.4", "@babel/types": "^7.7.4", @@ -342,9 +342,9 @@ } }, "@babel/generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", - "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { "@babel/types": "^7.7.4", @@ -600,9 +600,9 @@ } }, "@babel/parser": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", - "integrity": "sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -658,9 +658,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz", - "integrity": "sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.7.tgz", + "integrity": "sha512-3qp9I8lelgzNedI3hrhkvhaEYree6+WHnyA/q4Dza9z7iEIs1eyhWyJnetk3jJ69RT0AT4G0UhEGwyGFJ7GUuQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -678,9 +678,9 @@ } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.4.tgz", - "integrity": "sha512-cHgqHgYvffluZk85dJ02vloErm3Y6xtH+2noOBOJ2kXOJH3aVCDnj5eR/lVNlTnYu4hndAPJD3rTFjW3qee0PA==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.7.tgz", + "integrity": "sha512-80PbkKyORBUVm1fbTLrHpYdJxMThzM1UqFGh0ALEhO9TYbG86Ah9zQYAB/84axz2vcxefDLdZwWwZNlYARlu9w==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.7.4", @@ -843,9 +843,9 @@ } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.4.tgz", - "integrity": "sha512-mk0cH1zyMa/XHeb6LOTXTbG7uIJ8Rrjlzu91pUx/KS3JpcgaTDwMS8kM+ar8SLOvlL2Lofi4CGBAjCo3a2x+lw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.7.tgz", + "integrity": "sha512-b4in+YlTeE/QmTgrllnb3bHA0HntYvjz8O3Mcbx75UBPJA2xhb5A8nle498VhxSXJHQefjtQxpnLPehDJ4TRlg==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.7.4", @@ -981,9 +981,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.4.tgz", - "integrity": "sha512-VJwhVePWPa0DqE9vcfptaJSzNDKrWU/4FbYCjZERtmqEs05g3UMXnYMZoXja7JAJ7Y7sPZipwm/pGApZt7wHlw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.7.tgz", + "integrity": "sha512-OhGSrf9ZBrr1fw84oFXj5hgi8Nmg+E2w5L7NhnG0lPvpDtqd7dbyilM2/vR8CKbJ907RyxPh2kj6sBCSSfI9Ew==", "dev": true, "requires": { "@babel/helper-call-delegate": "^7.7.4", @@ -1010,9 +1010,9 @@ } }, "@babel/plugin-transform-react-jsx": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.4.tgz", - "integrity": "sha512-LixU4BS95ZTEAZdPaIuyg/k8FiiqN9laQ0dMHB4MlpydHY53uQdWCUrwjLr5o6ilS6fAgZey4Q14XBjl5tL6xw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.7.tgz", + "integrity": "sha512-SlPjWPbva2+7/ZJbGcoqjl4LsQaLpKEzxW9hcxU7675s24JmdotJOSJ4cgAbV82W3FcZpHIGmRZIlUL8ayMvjw==", "dev": true, "requires": { "@babel/helper-builder-react-jsx": "^7.7.4", @@ -1128,9 +1128,9 @@ } }, "@babel/preset-env": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.6.tgz", - "integrity": "sha512-k5hO17iF/Q7tR9Jv8PdNBZWYW6RofxhnxKjBMc0nG4JTaWvOTiPoO/RLFwAKcA4FpmuBFm6jkoqaRJLGi0zdaQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.7.tgz", + "integrity": "sha512-pCu0hrSSDVI7kCVUOdcMNQEbOPJ52E+LrQ14sN8uL2ALfSqePZQlKrOy+tM4uhEdYlCHi4imr8Zz2cZe9oSdIg==", "dev": true, "optional": true, "requires": { @@ -1139,9 +1139,9 @@ "@babel/plugin-proposal-async-generator-functions": "^7.7.4", "@babel/plugin-proposal-dynamic-import": "^7.7.4", "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.7", "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", "@babel/plugin-syntax-async-generators": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.7.4", "@babel/plugin-syntax-json-strings": "^7.7.4", @@ -1155,7 +1155,7 @@ "@babel/plugin-transform-classes": "^7.7.4", "@babel/plugin-transform-computed-properties": "^7.7.4", "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.7", "@babel/plugin-transform-duplicate-keys": "^7.7.4", "@babel/plugin-transform-exponentiation-operator": "^7.7.4", "@babel/plugin-transform-for-of": "^7.7.4", @@ -1169,7 +1169,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.7", "@babel/plugin-transform-property-literals": "^7.7.4", "@babel/plugin-transform-regenerator": "^7.7.5", "@babel/plugin-transform-reserved-words": "^7.7.4", @@ -1181,7 +1181,7 @@ "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/types": "^7.7.4", "browserslist": "^4.6.0", - "core-js-compat": "^3.4.7", + "core-js-compat": "^3.6.0", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.5.0" @@ -1220,17 +1220,17 @@ } }, "@babel/runtime": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz", - "integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz", + "integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==", "requires": { "regenerator-runtime": "^0.13.2" } }, "@babel/runtime-corejs3": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.7.6.tgz", - "integrity": "sha512-NrRUehqG0sMSCaP+0XV/vOvvjNl4BQOWq3Qys1Q2KTEm5tGMo9h0dHnIzeKerj0a7SIB8LP5kYg/T1raE3FoKQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.7.7.tgz", + "integrity": "sha512-kr3W3Fw8mB/CTru2M5zIRQZZgC/9zOxNSoJ/tVCzjPt3H1/p5uuGbz6WwmaQy/TLQcW31rUhUUWKY28sXFRelA==", "dev": true, "requires": { "core-js-pure": "^3.0.0", @@ -1883,6 +1883,11 @@ "@firebase/auth-types": "0.9.3" } }, + "@firebase/auth-interop-types": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.1.tgz", + "integrity": "sha512-rNpCOyCspZvNDoQVQLQQgWAGBMB2ClCWKN1c8cEFgLNFgnMJrjVB+tcL7KW2q2UjKa7l8Mxgwys7szTiEDAcvA==" + }, "@firebase/auth-types": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.9.3.tgz", @@ -1898,10 +1903,11 @@ } }, "@firebase/database": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.16.tgz", - "integrity": "sha512-m8qrt3irSiSkFP9i75nGWFasZFeFb5KAR6/fvWOoLMXQWE41LU7Z+osUaXWvGvPJxsoHD0EY+4+Blat4XiJx9g==", + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.17.tgz", + "integrity": "sha512-nufRBK1p2adTEDvUQ1lEfa0nd2BvBe6tlDbO0q9zMQaTMg9dDjTomKRsc3byyRDhhTwDNwX4oUCFCTNTOHoKaA==", "requires": { + "@firebase/auth-interop-types": "0.1.1", "@firebase/component": "0.1.1", "@firebase/database-types": "0.4.10", "@firebase/logger": "0.1.33", @@ -1919,9 +1925,9 @@ } }, "@firebase/firestore": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.9.0.tgz", - "integrity": "sha512-bcVfzGmj5qweUD1eYcezoCYeVl6oNlkc+s47EJBoNrmvWuvKeaiUy+RhB6hFblJCXUmecCuYUT2UA7CKipbEIQ==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.9.1.tgz", + "integrity": "sha512-b3MsfyXxE65HirKdR9R/EI++1esyU4Mg8UN5LA+3Kbov7qMAPqHpXdrZy1v4Ng3+ZA2NC7Y08boaIgudr98sGA==", "requires": { "@firebase/component": "0.1.1", "@firebase/firestore-types": "1.9.0", @@ -2128,15 +2134,15 @@ } }, "@google-cloud/firestore": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-2.6.1.tgz", - "integrity": "sha512-ZzjaNn8TLji2HpC/h4uDuOb+h7lf1YCiNRiHhLkCUuEp+xAt1uPAkLFLAamGYW26v9VIe+9H/3l27pkplFsybQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-3.0.0.tgz", + "integrity": "sha512-Os6rXW6z9bd2sVdjDJRUneF5u7keH+vpWX/Uddq0dlFyNbwBSgCBFWt+0VYXkgQE+O8B8i1p+FdaleTjFFuRVA==", "optional": true, "requires": { "bun": "^0.0.12", - "deep-equal": "^1.0.1", + "deep-equal": "^1.1.1", "functional-red-black-tree": "^1.0.1", - "google-gax": "^1.7.5", + "google-gax": "^1.12.0", "through2": "^3.0.0" } }, @@ -2227,9 +2233,9 @@ } }, "@grpc/grpc-js": { - "version": "0.6.14", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.14.tgz", - "integrity": "sha512-M6q3MtHzk0NQPs1PB+SXSJtkDtK8WXJh+1B1WVJQp5HTURadzj9t1bUb/Fjhq+K57lKsOgL60r8WGmE7vks1eg==", + "version": "0.6.15", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.15.tgz", + "integrity": "sha512-BFK5YMu8JILedibo0nr3NYM0ZC5hCZuXtzk10wEUp3d3pH11PjdvTfN1yEJ0VsfBY5Gtp3WOQ+t7Byq0NzH/iQ==", "optional": true, "requires": { "semver": "^6.2.0" @@ -2605,9 +2611,9 @@ }, "dependencies": { "@types/react": { - "version": "16.9.16", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", - "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "version": "16.9.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.17.tgz", + "integrity": "sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==", "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4021,9 +4027,9 @@ "dev": true }, "@types/connect": { - "version": "3.4.32", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", - "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", + "version": "3.4.33", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", + "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", "requires": { "@types/node": "*" } @@ -4066,9 +4072,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.0.tgz", - "integrity": "sha512-Xnub7w57uvcBqFdIGoRg1KhNOeEj0vB6ykUM7uFWyxvbdE89GFyqgmUcanAriMr4YOxNFZBAWkfcWIb4WBPt3g==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.1.tgz", + "integrity": "sha512-9e7jj549ZI+RxY21Cl0t8uBnWyb22HzILupyHZjYEVK//5TT/1bZodU+yUbLnPdoYViBBnNWbxp4zYjGV0zUGw==", "requires": { "@types/node": "*", "@types/range-parser": "*" @@ -4107,9 +4113,9 @@ }, "dependencies": { "@types/react": { - "version": "16.9.16", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", - "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "version": "16.9.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.17.tgz", + "integrity": "sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==", "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4118,9 +4124,9 @@ } }, "@types/invariant": { - "version": "2.2.30", - "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.30.tgz", - "integrity": "sha512-98fB+yo7imSD2F7PF7GIpELNgtLNgo5wjivu0W5V4jx+KVVJxo6p/qN4zdzSTBWy4/sN3pPyXwnhRSD28QX+ag==" + "version": "2.2.31", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.31.tgz", + "integrity": "sha512-jMlgg9pIURvy9jgBHCjQp/CyBjYHUwj91etVcDdXkFl2CwTFiQlB+8tcsMeXpXf2PFE5X2pjk4Gm43hQSMHAdA==" }, "@types/istanbul-lib-coverage": { "version": "2.0.1", @@ -4191,9 +4197,9 @@ "dev": true }, "@types/node": { - "version": "12.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.18.tgz", - "integrity": "sha512-DBkZuIMFuAfjJHiunyRc+aNvmXYNwV1IPMgGKGlwCp6zh6MKrVtmvjSWK/axWcD25KJffkXgkfvFra8ndenXAw==" + "version": "12.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz", + "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -4226,6 +4232,7 @@ "version": "16.9.16", "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "dev": true, "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4279,9 +4286,9 @@ }, "dependencies": { "@types/react": { - "version": "16.9.16", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", - "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "version": "16.9.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.17.tgz", + "integrity": "sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==", "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4340,9 +4347,9 @@ }, "dependencies": { "@types/react": { - "version": "16.9.16", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz", - "integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==", + "version": "16.9.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.17.tgz", + "integrity": "sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==", "requires": { "@types/prop-types": "*", "csstype": "^2.2.0" @@ -4414,58 +4421,6 @@ "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "tsutils": "^3.17.1" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", - "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.10.0", - "eslint-scope": "^5.0.0" - } - }, - "@typescript-eslint/typescript-estree": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", - "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash.unescape": "4.0.1", - "semver": "^6.3.0", - "tsutils": "^3.17.1" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "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, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@typescript-eslint/experimental-utils": { @@ -4489,58 +4444,6 @@ "@typescript-eslint/experimental-utils": "2.12.0", "@typescript-eslint/typescript-estree": "2.12.0", "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", - "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.10.0", - "eslint-scope": "^5.0.0" - } - }, - "@typescript-eslint/typescript-estree": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", - "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash.unescape": "4.0.1", - "semver": "^6.3.0", - "tsutils": "^3.17.1" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "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, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@typescript-eslint/typescript-estree": { @@ -6962,19 +6865,27 @@ "integrity": "sha512-b+BBmCZmVgho8KnBUOXpvlqEMguko+0P+kXCwD4vIprsXC6ht1qgPxtb1OK6XgSlrySF71wkwBQ0Hv695bk9gQ==" }, "core-js-compat": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.5.0.tgz", - "integrity": "sha512-E7iJB72svRjJTnm9HDvujzNVMCm3ZcDYEedkJ/sDTNsy/0yooCd9Cg7GSzE7b4e0LfIkjijdB1tqg0pGwxWeWg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.0.tgz", + "integrity": "sha512-Z3eCNjGgoYluH89Jt4wVkfYsc/VdLrA2/woX5lm0isO/pCT+P+Y+o65bOuEnjDJLthdwTBxbCVzptTXtc18fJg==", "dev": true, "requires": { "browserslist": "^4.8.2", - "semver": "^6.3.0" + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } } }, "core-js-pure": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.5.0.tgz", - "integrity": "sha512-wB0QtKAofWigiISuT1Tej3hKgq932fB//Lf1VoPbiLpTYlHY0nIDhgF+q1na0DAKFHH5wGCirkAknOmDN8ijXA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.0.tgz", + "integrity": "sha512-+YSSo7UFDFuVvMUr1HVFYArb22pYIKRDISBo6V50kRuS0MsXgsuDWmJYFu6dJsJupr77S486xRnDkr/BWQQonw==", "dev": true }, "core-util-is": { @@ -9441,16 +9352,16 @@ } }, "firebase": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.6.0.tgz", - "integrity": "sha512-4hjPrcNDF3E3vvoe+IDcnxu+Z4w7xxDBHZAmLjTAPPmtc8Ifb6vJ99tESGIb0Ncx+5Bl1nZK9um6qTf9fgGtqA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.6.1.tgz", + "integrity": "sha512-rrKp2cWmrH3gdxr+3t97t6eGye4VJTOYo6U98jvGi+OA4ZSKTSrCMXN6nZkAVOkSCvn/fgw//oHV+7VsJskB/Q==", "requires": { "@firebase/analytics": "0.2.9", "@firebase/app": "0.5.0", "@firebase/app-types": "0.5.0", "@firebase/auth": "0.13.3", - "@firebase/database": "0.5.16", - "@firebase/firestore": "1.9.0", + "@firebase/database": "0.5.17", + "@firebase/firestore": "1.9.1", "@firebase/functions": "0.4.28", "@firebase/installations": "0.3.8", "@firebase/messaging": "0.6.0", @@ -9462,14 +9373,14 @@ } }, "firebase-admin": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-8.8.0.tgz", - "integrity": "sha512-IKtyL7doZu3Sh3pCz+O7vFWc/UwxEfXe263X/bPbucu/qEsM+5UdljIklnInSMunO+A1BUXKtsKkQf91iZQ2Ew==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-8.9.0.tgz", + "integrity": "sha512-ZslYhJeLm0GH6tZbDQanrnqqpMnvzWyVTygbT0Dde6ExkiJnYrFAEoxc8U7lbhMF13RHYH2Yj4x0hPoZyp/43A==", "requires": { - "@firebase/database": "^0.5.11", - "@google-cloud/firestore": "^2.6.0", + "@firebase/database": "^0.5.17", + "@google-cloud/firestore": "^3.0.0", "@google-cloud/storage": "^4.1.2", - "@types/node": "^8.0.53", + "@types/node": "^8.10.59", "dicer": "^0.3.0", "jsonwebtoken": "8.1.0", "node-forge": "0.7.4" @@ -12043,9 +11954,9 @@ "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" }, "is-ci": { "version": "1.2.1", @@ -12091,9 +12002,9 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" }, "is-descriptor": { "version": "0.1.6", @@ -14657,9 +14568,9 @@ "integrity": "sha512-o4aN0GqKcDmKwu2wVsqbujU4F63ZvmbBLSc7WhzuAu9S9eF2wgNjqIkzrb/kbY3C9/mGYG4k1M0KbCuG1GJ7IQ==" }, "mobx-react-lite": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-1.5.1.tgz", - "integrity": "sha512-40Gn8hFq+MuNHqCaeSo2adN4WvpWkIeSYZVJWzRzm0rbEf0BFow6Ir9IefErql0pX9q650TN1JAQXvrXxKR8Mg==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-1.5.2.tgz", + "integrity": "sha512-PyZmARqqWtpuQaAoHF5pKX7h6TKNLwq6vtovm4zZvG6sEbMRHHSqioGXSeQbpRmG8Kw8uln3q/W1yMO5IfL5Sg==" }, "mobx-react-router": { "version": "4.1.0", @@ -14894,9 +14805,9 @@ } }, "node-releases": { - "version": "1.1.42", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.42.tgz", - "integrity": "sha512-OQ/ESmUqGawI2PRX+XIRao44qWYBBfN54ImQYdWVTQqUckuejOg76ysSqDBK8NG3zwySRVnX36JwDQ6x+9GxzA==", + "version": "1.1.43", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.43.tgz", + "integrity": "sha512-Rmfnj52WNhvr83MvuAWHEqXVoZXCcDQssSOffU4n4XOL9sPrP61mSZ88g25NqmABDvH7PiAlFCzoSCSdzA293w==", "dev": true, "requires": { "semver": "^6.3.0" @@ -16574,9 +16485,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.9.tgz", - "integrity": "sha512-+6VygF9LbG7Gaqeog2G7u1+RUcmo0q1rI+2ZxdIg2fAUngk5Vz9fOCHXdloNUOHEPd1EuuOpL5O0CdgN9Fx5UQ==" + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==" } } }, @@ -17307,9 +17218,9 @@ "dev": true }, "resolve": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", - "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "requires": { "path-parse": "^1.0.6" } @@ -18745,18 +18656,18 @@ } }, "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" } }, "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" @@ -19085,9 +18996,9 @@ } }, "term-size": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.1.0.tgz", - "integrity": "sha512-I42EWhJ+2aeNQawGx1VtpO0DFI9YcfuvAMNIdKyf/6sRbHJ4P+ZQ/zIT87tE+ln1ymAGcCJds4dolfSAS0AcNg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.1.1.tgz", + "integrity": "sha512-UqvQSch04R+69g4RDhrslmGvGL3ucDRX/U+snYW0Mab4uCAyKSndUksaoqlJ81QKSpRnIsuOYQCbC2ZWx2896A==", "dev": true }, "terser": { From 3149ae636fc8781d9d88375893337b7e64d8424d Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 22 Dec 2019 06:51:08 +0300 Subject: [PATCH 8/9] (tech) styles moved inside makeStyles function --- .../src/app/components/Snowflakes.tsx | 50 +++++++++++++++---- .../app/components/hooks/useSnowflakes.tsx | 46 +++++++++-------- .../src/app/components/styles/snowflakes.css | 18 ------- .../app/components/styles/snowflakesMedia.css | 31 ------------ 4 files changed, 65 insertions(+), 80 deletions(-) delete mode 100644 apps/js-machine-front/src/app/components/styles/snowflakes.css delete mode 100644 apps/js-machine-front/src/app/components/styles/snowflakesMedia.css diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index 741ff55..ff50cc4 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -1,8 +1,5 @@ import React from 'react'; -import './styles/snowflakes.css'; -import './styles/snowflakesMedia.css'; - import Switch from '@material-ui/core/Switch'; import { makeStyles } from '@material-ui/core/styles'; @@ -14,7 +11,37 @@ export function Snowflakes() { const MAIN_YELLOW = '#F2E14C'; - const useStyles = makeStyles({ + const useStyles = makeStyles( theme => ({ + snow: { + position: 'fixed', + height: '100%', + width: '100%', + zIndex: 1, + pointerEvents: 'none', + }, + snowSwitcher: { + display: 'flex', + color: 'white', + position: 'absolute', + zIndex: 1101, + [theme.breakpoints.up('md')]: { + top: '29px', + left: '38px', + }, + [theme.breakpoints.down('sm')]: { + top: '18px', + left: '24px', + }, + [theme.breakpoints.down('xs')]: { + top: '-2px', + left: '-4px', + flexDirection: 'row-reverse', + }, + }, + snowSwitcherLabel: { + fontSize: '0.9rem', + }, + colorSecondary: { '&$checked': { color: MAIN_YELLOW, @@ -35,23 +62,28 @@ export function Snowflakes() { }, track: {}, checked: {}, - }); + })); const classes = useStyles(); return ( <> -
- Happy New Year +
+ Happy New Year
- + ); } \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx b/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx index cacd60c..ce57a2a 100644 --- a/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx +++ b/apps/js-machine-front/src/app/components/hooks/useSnowflakes.tsx @@ -14,28 +14,30 @@ export function useSnowflakes() { const handleSnowSwitch = useCallback(() => { setSnowing(!isSnowing); }, [isSnowing]); - - const getCanvasElementById = useCallback((id: string): HTMLCanvasElement => { - const canvas = document.getElementById(id); - - if (!(canvas instanceof HTMLCanvasElement)) { - throw new Error(`The element of id "${id}" is not a HTMLCanvasElement. Make sure a element is present in the document.`); - } - - return canvas; - }, []); - - const getCanvasRenderingContext2D = useCallback((canvas: HTMLCanvasElement): CanvasRenderingContext2D => { - const context = canvas.getContext('2d'); - - if (!(context instanceof CanvasRenderingContext2D)) { - throw new Error('This browser does not support 2-dimensional canvas rendering contexts.'); - } - - return context; - }, []); - const startSnowflakes = useCallback( () => { + + const startSnowflakes = useCallback(() => { + + const getCanvasElementById = (id: string): HTMLCanvasElement => { + const canvas = document.getElementById('snow'); + + if (!(canvas instanceof HTMLCanvasElement)) { + throw new Error(`The element of id "${id}" is not a HTMLCanvasElement. Make sure a element is present in the document.`); + } + + return canvas; + }; + + const getCanvasRenderingContext2D = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => { + const context = canvas.getContext('2d'); + + if (!(context instanceof CanvasRenderingContext2D)) { + throw new Error('This browser does not support 2-dimensional canvas rendering contexts.'); + } + + return context; + }; + const canvas: HTMLCanvasElement = getCanvasElementById('snow'); const ctx: CanvasRenderingContext2D = getCanvasRenderingContext2D(canvas); @@ -132,5 +134,5 @@ export function useSnowflakes() { }; }, [isSnowing]); - return {isSnowing, handleSnowSwitch}; + return { isSnowing, handleSnowSwitch }; }; \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/styles/snowflakes.css b/apps/js-machine-front/src/app/components/styles/snowflakes.css deleted file mode 100644 index ea90a9f..0000000 --- a/apps/js-machine-front/src/app/components/styles/snowflakes.css +++ /dev/null @@ -1,18 +0,0 @@ -#snow { - position: fixed; - height: 100%; - width: 100%; - z-index: 1; - pointer-events: none; -} - -.snow-switcher { - display: flex; - position: absolute; - z-index: 1101; - color: white; -} - -.snow-switcher__label { - font-size: 0.9rem;; -} \ No newline at end of file diff --git a/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css b/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css deleted file mode 100644 index 67cbc86..0000000 --- a/apps/js-machine-front/src/app/components/styles/snowflakesMedia.css +++ /dev/null @@ -1,31 +0,0 @@ -@media screen and (min-width: 960px) { - .snow-switcher { - top: 29px; - left: 38px; - } -} - -@media screen and (max-width: 959px) { - .snow-switcher { - top: 18px; - left: 24px; - } -} - -@media screen and (max-width: 600px) { - .snow-switcher { - top: 0px; - left: -4px; - flex-direction: row-reverse; - } -} - -@media screen and (max-width: 600px) and (orientation: landscape) { - .snow-switcher { - top: -2px; - } - - .snow-switcher__label { - font-size: 0.9rem; - } -} \ No newline at end of file From 6841e72f097f0f090c137162d57e56a0a7d5c815 Mon Sep 17 00:00:00 2001 From: Vladimir Sviridenko Date: Sun, 22 Dec 2019 15:13:01 +0300 Subject: [PATCH 9/9] useStyles variable created outside of component --- .../src/app/components/Snowflakes.tsx | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/apps/js-machine-front/src/app/components/Snowflakes.tsx b/apps/js-machine-front/src/app/components/Snowflakes.tsx index ff50cc4..0ed3b2d 100644 --- a/apps/js-machine-front/src/app/components/Snowflakes.tsx +++ b/apps/js-machine-front/src/app/components/Snowflakes.tsx @@ -5,64 +5,64 @@ import { makeStyles } from '@material-ui/core/styles'; import { useSnowflakes } from './hooks/useSnowflakes'; -export function Snowflakes() { - - const {isSnowing, handleSnowSwitch} = useSnowflakes(); - - const MAIN_YELLOW = '#F2E14C'; +const MAIN_YELLOW = '#F2E14C'; - const useStyles = makeStyles( theme => ({ - snow: { - position: 'fixed', - height: '100%', - width: '100%', - zIndex: 1, - pointerEvents: 'none', +const useStyles = makeStyles( theme => ({ + snow: { + position: 'fixed', + height: '100%', + width: '100%', + zIndex: 1, + pointerEvents: 'none', + }, + snowSwitcher: { + display: 'flex', + color: 'white', + position: 'absolute', + zIndex: 1101, + [theme.breakpoints.up('md')]: { + top: '29px', + left: '38px', }, - snowSwitcher: { - display: 'flex', - color: 'white', - position: 'absolute', - zIndex: 1101, - [theme.breakpoints.up('md')]: { - top: '29px', - left: '38px', - }, - [theme.breakpoints.down('sm')]: { - top: '18px', - left: '24px', - }, - [theme.breakpoints.down('xs')]: { - top: '-2px', - left: '-4px', - flexDirection: 'row-reverse', - }, + [theme.breakpoints.down('sm')]: { + top: '18px', + left: '24px', }, - snowSwitcherLabel: { - fontSize: '0.9rem', + [theme.breakpoints.down('xs')]: { + top: '-2px', + left: '-4px', + flexDirection: 'row-reverse', }, + }, + snowSwitcherLabel: { + fontSize: '0.9rem', + }, - colorSecondary: { - '&$checked': { - color: MAIN_YELLOW, - }, + colorSecondary: { + '&$checked': { + color: MAIN_YELLOW, }, - switchBase: { + }, + switchBase: { + color: 'white', + '&$checked': { color: 'white', - '&$checked': { - color: 'white', - '& + $track': { - backgroundColor: MAIN_YELLOW, - opacity: 1, - }, - "&:hover": { - backgroundColor: '#f2e14c4d', - }, + '& + $track': { + backgroundColor: MAIN_YELLOW, + opacity: 1, + }, + "&:hover": { + backgroundColor: '#f2e14c4d', }, }, - track: {}, - checked: {}, - })); + }, + track: {}, + checked: {}, +})); + +export function Snowflakes() { + + const {isSnowing, handleSnowSwitch} = useSnowflakes(); const classes = useStyles();