diff --git a/package-lock.json b/package-lock.json index 544074e3a..50090b875 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "autoprefixer": "^9.0.1", "base64-loader": "1.0.0", "bowser": "1.9.4", + "cat-blocks": "npm:scratch-blocks@0.1.0-prerelease.20220318143026", "classnames": "2.2.6", "computed-style-to-inline-style": "3.0.0", "copy-webpack-plugin": "6.4.1", @@ -7835,6 +7836,14 @@ "ajv": "^6.9.1" } }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "engines": { + "node": ">=0.4.2" + } + }, "node_modules/ansi-colors": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", @@ -9762,6 +9771,89 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "node_modules/cat-blocks": { + "name": "scratch-blocks", + "version": "0.1.0-prerelease.20220318143026", + "resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20220318143026.tgz", + "integrity": "sha512-eYJYzjYt3fmF5a243eBIgQfNj+c3ApHFE8jkm1KV/tEiFanJ8XlLZay9LmbnhYhK0618+s0uEQrpJ9WC6xnX/Q==", + "dependencies": { + "exports-loader": "0.6.3", + "google-closure-library": "20190301.0.0", + "imports-loader": "0.6.5", + "scratch-l10n": "3.14.20220317031619" + } + }, + "node_modules/cat-blocks/node_modules/big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "engines": { + "node": "*" + } + }, + "node_modules/cat-blocks/node_modules/exports-loader": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-0.6.3.tgz", + "integrity": "sha512-vBQgTnvmEB7qWmr7gzAzJRWptzYhkhvdXeH8sRnS//mIai6MgLZe1crlQ+VWTjCCXLlnhGuiuVMq0YfjA5AUOw==", + "dependencies": { + "loader-utils": "0.2.x", + "source-map": "0.1.x" + } + }, + "node_modules/cat-blocks/node_modules/imports-loader": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/imports-loader/-/imports-loader-0.6.5.tgz", + "integrity": "sha512-fYIzBL9JOzJszvfeSGSKVjAtkWEtPUwP+OWiUxIWApcxsYh3iqZWZAp8xjTuhsvqglhqaetxeLLTaYyxIv1d4Q==", + "dependencies": { + "loader-utils": "0.2.x", + "source-map": "0.1.x" + } + }, + "node_modules/cat-blocks/node_modules/json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/cat-blocks/node_modules/loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==", + "dependencies": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "node_modules/cat-blocks/node_modules/scratch-l10n": { + "version": "3.14.20220317031619", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.14.20220317031619.tgz", + "integrity": "sha512-tDKXRFxKFob9htBeOu+873mujoePXc4sGQulWDdMVCM8cYz63geCWziX5fCwp2pu3pJKQLEth0ftd2eoXkT1RA==", + "dependencies": { + "@babel/cli": "^7.1.2", + "@babel/core": "^7.1.2", + "babel-plugin-react-intl": "^3.0.1", + "transifex": "1.6.6" + }, + "bin": { + "build-i18n-src": "scripts/build-i18n-src.js", + "tx-push-src": "scripts/tx-push-src.js" + } + }, + "node_modules/cat-blocks/node_modules/source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==", + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -14434,6 +14526,7 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/ansi-regex": { @@ -14441,6 +14534,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14451,6 +14545,7 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/are-we-there-yet": { @@ -14458,6 +14553,7 @@ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -14469,6 +14565,7 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/brace-expansion": { @@ -14476,6 +14573,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "balanced-match": "^1.0.0", @@ -14487,6 +14585,7 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/code-point-at": { @@ -14494,6 +14593,7 @@ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14504,6 +14604,7 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/console-control-strings": { @@ -14511,6 +14612,7 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/core-util-is": { @@ -14518,14 +14620,15 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "ms": "^2.1.1" @@ -14536,6 +14639,7 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=4.0.0" @@ -14546,6 +14650,7 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/detect-libc": { @@ -14553,6 +14658,7 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "inBundle": true, + "license": "Apache-2.0", "optional": true, "bin": { "detect-libc": "bin/detect-libc.js" @@ -14566,6 +14672,7 @@ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "minipass": "^2.2.1" @@ -14576,6 +14683,7 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/gauge": { @@ -14583,6 +14691,7 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "aproba": "^1.0.3", @@ -14600,6 +14709,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -14618,6 +14728,7 @@ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/iconv-lite": { @@ -14625,6 +14736,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -14638,6 +14750,7 @@ "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "minimatch": "^3.0.4" @@ -14648,6 +14761,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "once": "^1.3.0", @@ -14659,13 +14773,24 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "inBundle": true, + "license": "ISC", "optional": true }, + "node_modules/fsevents/node_modules/ini": { + "version": "1.3.5", + "inBundle": true, + "license": "ISC", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/fsevents/node_modules/is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "number-is-nan": "^1.0.0" @@ -14679,6 +14804,7 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/minimatch": { @@ -14686,6 +14812,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -14699,6 +14826,7 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/minipass": { @@ -14706,6 +14834,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "safe-buffer": "^5.1.2", @@ -14717,6 +14846,7 @@ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "minipass": "^2.2.1" @@ -14726,8 +14856,8 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "minimist": "0.0.8" @@ -14741,6 +14871,7 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/needle": { @@ -14748,6 +14879,7 @@ "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "debug": "^4.1.0", @@ -14765,8 +14897,8 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", - "deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future", "inBundle": true, + "license": "BSD-3-Clause", "optional": true, "dependencies": { "detect-libc": "^1.0.2", @@ -14789,6 +14921,7 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "abbrev": "1", @@ -14803,6 +14936,7 @@ "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/npm-packlist": { @@ -14810,6 +14944,7 @@ "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "ignore-walk": "^3.0.1", @@ -14821,6 +14956,7 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "are-we-there-yet": "~1.1.2", @@ -14834,6 +14970,7 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14844,6 +14981,7 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14854,6 +14992,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "wrappy": "1" @@ -14864,6 +15003,7 @@ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14874,6 +15014,7 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14884,6 +15025,7 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "os-homedir": "^1.0.0", @@ -14895,6 +15037,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -14905,6 +15048,7 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/rc": { @@ -14912,6 +15056,7 @@ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "inBundle": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "optional": true, "dependencies": { "deep-extend": "^0.6.0", @@ -14928,6 +15073,7 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/readable-stream": { @@ -14935,6 +15081,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "core-util-is": "~1.0.0", @@ -14951,6 +15098,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "glob": "^7.1.3" @@ -14964,6 +15112,7 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/safer-buffer": { @@ -14971,6 +15120,7 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/sax": { @@ -14978,6 +15128,7 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/semver": { @@ -14985,6 +15136,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "inBundle": true, + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver" @@ -14995,6 +15147,7 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/signal-exit": { @@ -15002,6 +15155,7 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/string_decoder": { @@ -15009,6 +15163,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "safe-buffer": "~5.1.0" @@ -15019,6 +15174,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "code-point-at": "^1.0.0", @@ -15034,6 +15190,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^2.0.0" @@ -15047,6 +15204,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -15057,6 +15215,7 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "chownr": "^1.1.1", @@ -15076,6 +15235,7 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/wide-align": { @@ -15083,6 +15243,7 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "string-width": "^1.0.2 || 2" @@ -15093,6 +15254,7 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/yallist": { @@ -15100,6 +15262,7 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/function-bind": { @@ -37032,6 +37195,11 @@ "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", "requires": {} }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==" + }, "ansi-colors": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", @@ -38624,6 +38792,77 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "cat-blocks": { + "version": "npm:scratch-blocks@0.1.0-prerelease.20220318143026", + "resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20220318143026.tgz", + "integrity": "sha512-eYJYzjYt3fmF5a243eBIgQfNj+c3ApHFE8jkm1KV/tEiFanJ8XlLZay9LmbnhYhK0618+s0uEQrpJ9WC6xnX/Q==", + "requires": { + "exports-loader": "0.6.3", + "google-closure-library": "20190301.0.0", + "imports-loader": "0.6.5", + "scratch-l10n": "3.14.20220317031619" + }, + "dependencies": { + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + }, + "exports-loader": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-0.6.3.tgz", + "integrity": "sha512-vBQgTnvmEB7qWmr7gzAzJRWptzYhkhvdXeH8sRnS//mIai6MgLZe1crlQ+VWTjCCXLlnhGuiuVMq0YfjA5AUOw==", + "requires": { + "loader-utils": "0.2.x", + "source-map": "0.1.x" + } + }, + "imports-loader": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/imports-loader/-/imports-loader-0.6.5.tgz", + "integrity": "sha512-fYIzBL9JOzJszvfeSGSKVjAtkWEtPUwP+OWiUxIWApcxsYh3iqZWZAp8xjTuhsvqglhqaetxeLLTaYyxIv1d4Q==", + "requires": { + "loader-utils": "0.2.x", + "source-map": "0.1.x" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==" + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==", + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "scratch-l10n": { + "version": "3.14.20220317031619", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.14.20220317031619.tgz", + "integrity": "sha512-tDKXRFxKFob9htBeOu+873mujoePXc4sGQulWDdMVCM8cYz63geCWziX5fCwp2pu3pJKQLEth0ftd2eoXkT1RA==", + "requires": { + "@babel/cli": "^7.1.2", + "@babel/core": "^7.1.2", + "babel-plugin-react-intl": "^3.0.1", + "transifex": "1.6.6" + } + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==", + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -42549,6 +42788,11 @@ "bundled": true, "optional": true }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", diff --git a/package.json b/package.json index 6f9dd929c..e0205e489 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "autoprefixer": "^9.0.1", "base64-loader": "1.0.0", "bowser": "1.9.4", + "cat-blocks": "npm:scratch-blocks@0.1.0-prerelease.20220318143026", "classnames": "2.2.6", "computed-style-to-inline-style": "3.0.0", "copy-webpack-plugin": "6.4.1", diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index a44604898..4ffd8aad4 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -21,6 +21,9 @@ import MenuBar from '../menu-bar/menu-bar.jsx'; import CostumeLibrary from '../../containers/costume-library.jsx'; import BackdropLibrary from '../../containers/backdrop-library.jsx'; import Watermark from '../../containers/watermark.jsx'; +import OldTimeyMode from '../oldtimey-mode/oldtimey-mode.jsx'; +import NinetiesMode from '../nineties-mode/nineties-mode.jsx'; +import PrehistoricMode from '../prehistoric-mode/prehistoric-mode.jsx'; import Backpack from '../../containers/backpack.jsx'; import WebGlModal from '../../containers/webgl-modal.jsx'; @@ -64,6 +67,7 @@ const GUIComponent = props => { backdropLibraryVisible, backpackHost, backpackVisible, + blocksId, blocksTabVisible, cardsVisible, canChangeLanguage, @@ -87,6 +91,7 @@ const GUIComponent = props => { isRtl, isShared, isTelemetryEnabled, + isTotallyNormal, loading, logo, renderLogin, @@ -160,6 +165,9 @@ const GUIComponent = props => { dir={isRtl ? 'rtl' : 'ltr'} {...componentProps} > + + + {telemetryModalVisible ? ( { className={styles.menuBarPosition} enableCommunity={enableCommunity} isShared={isShared} + isTotallyNormal={isTotallyNormal} logo={logo} renderLogin={renderLogin} showComingSoon={showComingSoon} @@ -300,6 +309,7 @@ const GUIComponent = props => { ({ // This is the button's mode, as opposed to the actual current state - stageSizeMode: state.scratchGui.stageSize.stageSize + stageSizeMode: state.scratchGui.stageSize.stageSize, + blocksId: state.scratchGui.timeTravel.year.toString() }); export default injectIntl(connect( diff --git a/src/components/menu-bar/cat_logo.svg b/src/components/menu-bar/cat_logo.svg new file mode 100644 index 000000000..05a1c4e22 --- /dev/null +++ b/src/components/menu-bar/cat_logo.svg @@ -0,0 +1 @@ +Scratch \ No newline at end of file diff --git a/src/components/menu-bar/menu-bar.css b/src/components/menu-bar/menu-bar.css index 78c639c15..f2b401385 100644 --- a/src/components/menu-bar/menu-bar.css +++ b/src/components/menu-bar/menu-bar.css @@ -39,7 +39,9 @@ align-items: center; flex-grow: 1; } - +.inactive { + opacity: 0; +} .scratch-logo { height: 1.6rem; vertical-align: middle; diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index 126f0d460..5aba0ffaf 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -31,6 +31,14 @@ import MenuBarHOC from '../../containers/menu-bar-hoc.jsx'; import {openTipsLibrary} from '../../reducers/modals'; import {setPlayer} from '../../reducers/mode'; +import { + isTimeTravel220022BC, + isTimeTravel1920, + isTimeTravel1990, + isTimeTravel2020, + isTimeTravelNow, + setTimeTravel +} from '../../reducers/time-travel'; import { autoUpdateProject, getIsUpdating, @@ -58,7 +66,10 @@ import { languageMenuOpen, openLoginMenu, closeLoginMenu, - loginMenuOpen + loginMenuOpen, + openModeMenu, + closeModeMenu, + modeMenuOpen } from '../../reducers/menus'; import collectMetadata from '../../lib/collect-metadata'; @@ -74,6 +85,10 @@ import languageIcon from '../language-selector/language-icon.svg'; import aboutIcon from './icon--about.svg'; import scratchLogo from './scratch-logo.svg'; +import ninetiesLogo from './nineties_logo.svg'; +import catLogo from './cat_logo.svg'; +import prehistoricLogo from './prehistoric-logo.svg'; +import oldtimeyLogo from './oldtimey-logo.svg'; import sharedMessages from '../../lib/shared-messages'; @@ -167,6 +182,7 @@ class MenuBar extends React.Component { 'handleClickSaveAsCopy', 'handleClickSeeCommunity', 'handleClickShare', + 'handleSetMode', 'handleKeyPress', 'handleLanguageMouseUp', 'handleRestoreOption', @@ -228,6 +244,36 @@ class MenuBar extends React.Component { } } } + handleSetMode (mode) { + return () => { + // Turn on/off filters for modes. + if (mode === '1920') { + document.documentElement.style.filter = 'brightness(.9)contrast(.8)sepia(1.0)'; + document.documentElement.style.height = '100%'; + } else if (mode === '1990') { + document.documentElement.style.filter = 'hue-rotate(40deg)'; + document.documentElement.style.height = '100%'; + } else { + document.documentElement.style.filter = ''; + document.documentElement.style.height = ''; + } + + // Change logo for modes + if (mode === '1990') { + document.getElementById('logo_img').src = ninetiesLogo; + } else if (mode === '2020') { + document.getElementById('logo_img').src = catLogo; + } else if (mode === '1920') { + document.getElementById('logo_img').src = oldtimeyLogo; + } else if (mode === '220022BC') { + document.getElementById('logo_img').src = prehistoricLogo; + } else { + document.getElementById('logo_img').src = this.props.logo; + } + + this.props.onSetTimeTravelMode(mode); + }; + } handleRestoreOption (restoreFun) { return () => { restoreFun(); @@ -390,6 +436,7 @@ class MenuBar extends React.Component {
Scratch +
+ {this.props.isTotallyNormal && ( +
+
+ +
+ + + + + {'✓'} + + {' '} + + + + + {'✓'} + + {' '} + + + + +
+ )}
{ languageMenuOpen: languageMenuOpen(state), locale: state.locales.locale, loginMenuOpen: loginMenuOpen(state), + modeMenuOpen: modeMenuOpen(state), projectTitle: state.scratchGui.projectTitle, sessionExists: state.session && typeof state.session.session !== 'undefined', username: user ? user.username : null, userOwnsProject: ownProps.authorUsername && user && (ownProps.authorUsername === user.username), - vm: state.scratchGui.vm + vm: state.scratchGui.vm, + mode220022BC: isTimeTravel220022BC(state), + mode1920: isTimeTravel1920(state), + mode1990: isTimeTravel1990(state), + mode2020: isTimeTravel2020(state), + modeNow: isTimeTravelNow(state) }; }; @@ -867,13 +979,16 @@ const mapDispatchToProps = dispatch => ({ onRequestCloseLanguage: () => dispatch(closeLanguageMenu()), onClickLogin: () => dispatch(openLoginMenu()), onRequestCloseLogin: () => dispatch(closeLoginMenu()), + onClickMode: () => dispatch(openModeMenu()), + onRequestCloseMode: () => dispatch(closeModeMenu()), onRequestOpenAbout: () => dispatch(openAboutMenu()), onRequestCloseAbout: () => dispatch(closeAboutMenu()), onClickNew: needSave => dispatch(requestNewProject(needSave)), onClickRemix: () => dispatch(remixProject()), onClickSave: () => dispatch(manualUpdateProject()), onClickSaveAsCopy: () => dispatch(saveProjectAsCopy()), - onSeeCommunity: () => dispatch(setPlayer(true)) + onSeeCommunity: () => dispatch(setPlayer(true)), + onSetTimeTravelMode: mode => dispatch(setTimeTravel(mode)) }); export default compose( diff --git a/src/components/menu-bar/nineties_logo.svg b/src/components/menu-bar/nineties_logo.svg new file mode 100644 index 000000000..ac798ff4b --- /dev/null +++ b/src/components/menu-bar/nineties_logo.svg @@ -0,0 +1,2389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + s + + + C + + + R + + + s + + + H + + + T + + + R + + + T + + + H + + + C + + + C + + + C + + + R + + + T + + + R + + + R + + + H + + + R + + + C + + + A + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SCRATCH + + diff --git a/src/components/menu-bar/oldtimey-logo.svg b/src/components/menu-bar/oldtimey-logo.svg new file mode 100644 index 000000000..afc34cde2 --- /dev/null +++ b/src/components/menu-bar/oldtimey-logo.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/menu-bar/prehistoric-logo.svg b/src/components/menu-bar/prehistoric-logo.svg new file mode 100644 index 000000000..a18055270 --- /dev/null +++ b/src/components/menu-bar/prehistoric-logo.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/nineties-mode/nineties-mode.css b/src/components/nineties-mode/nineties-mode.css new file mode 100644 index 000000000..0d09ccef4 --- /dev/null +++ b/src/components/nineties-mode/nineties-mode.css @@ -0,0 +1,9 @@ +.nineties-mode { + position: absolute; + width: 100%; + height: 100%; + background: transparent url('./shapes.svg'); + z-index: 50; + opacity: .2; + pointer-events: none; +} diff --git a/src/components/nineties-mode/nineties-mode.jsx b/src/components/nineties-mode/nineties-mode.jsx new file mode 100644 index 000000000..77e65fda5 --- /dev/null +++ b/src/components/nineties-mode/nineties-mode.jsx @@ -0,0 +1,23 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import styles from './nineties-mode.css'; +import {connect} from 'react-redux'; +import {isTimeTravel1990} from '../../reducers/time-travel'; + +const NinetiesMode = props => { + if (!props.show) return null; + return
; +}; + +NinetiesMode.propTypes = { + show: PropTypes.bool +}; + +const mapStateToProps = state => ({ + // This is the button's mode, as opposed to the actual current state + show: isTimeTravel1990(state) +}); + +export default connect( + mapStateToProps +)(NinetiesMode); diff --git a/src/components/nineties-mode/shapes.svg b/src/components/nineties-mode/shapes.svg new file mode 100644 index 000000000..deb2237e1 --- /dev/null +++ b/src/components/nineties-mode/shapes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/oldtimey-mode/oldtimey-mode.css b/src/components/oldtimey-mode/oldtimey-mode.css new file mode 100644 index 000000000..1deb573a4 --- /dev/null +++ b/src/components/oldtimey-mode/oldtimey-mode.css @@ -0,0 +1,9 @@ +.oldtimey-mode { + position: absolute; + width: 100%; + height: 100%; + background: transparent url('./oldtimey.png') center center; + background-size: 100% 100%; + z-index: 500; + pointer-events: none; +} \ No newline at end of file diff --git a/src/components/oldtimey-mode/oldtimey-mode.jsx b/src/components/oldtimey-mode/oldtimey-mode.jsx new file mode 100644 index 000000000..98d45b37a --- /dev/null +++ b/src/components/oldtimey-mode/oldtimey-mode.jsx @@ -0,0 +1,35 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import styles from './oldtimey-mode.css'; +import oldtimeySound from './projector2.mp3'; +import {connect} from 'react-redux'; +import {isTimeTravel1920} from '../../reducers/time-travel'; + +const OldTimeyMode = props => { + if (!props.show) return null; + return ( +
+
+ ); +}; + +OldTimeyMode.propTypes = { + show: PropTypes.bool +}; + +const mapStateToProps = state => ({ + // This is the button's mode, as opposed to the actual current state + show: isTimeTravel1920(state) +}); + +export default connect( + mapStateToProps +)(OldTimeyMode); diff --git a/src/components/oldtimey-mode/oldtimey.png b/src/components/oldtimey-mode/oldtimey.png new file mode 100644 index 000000000..ca0abe691 Binary files /dev/null and b/src/components/oldtimey-mode/oldtimey.png differ diff --git a/src/components/oldtimey-mode/projector.wav b/src/components/oldtimey-mode/projector.wav new file mode 100644 index 000000000..ff28aba5e Binary files /dev/null and b/src/components/oldtimey-mode/projector.wav differ diff --git a/src/components/oldtimey-mode/projector2.mp3 b/src/components/oldtimey-mode/projector2.mp3 new file mode 100644 index 000000000..a475951ee Binary files /dev/null and b/src/components/oldtimey-mode/projector2.mp3 differ diff --git a/src/components/prehistoric-mode/background.png b/src/components/prehistoric-mode/background.png new file mode 100644 index 000000000..90c68ccb4 Binary files /dev/null and b/src/components/prehistoric-mode/background.png differ diff --git a/src/components/prehistoric-mode/prehistoric-mode.css b/src/components/prehistoric-mode/prehistoric-mode.css new file mode 100644 index 000000000..962a3a039 --- /dev/null +++ b/src/components/prehistoric-mode/prehistoric-mode.css @@ -0,0 +1,49 @@ +.prehistoric-mode { + position: absolute; + width: 100%; + height: 100%; + overflow: hidden; +} + +.prehistoric-background{ + position: absolute; + width: 100%; + height: 100%; + opacity: 90%; + z-index: 50; + pointer-events: none; + background: transparent url('./background.png') center center; + animation:jitter 2.5s linear infinite; +} + + +@keyframes jitter{ + 0%{transform:scale(1.0385841106898348);} + 5% {transform:scale(1.045596657989466);} + 10% {transform:scale(1.029923116529907);} + 15% {transform:scale(1.059010318189378);} + 20% {transform:scale(1.0868915738701577);} + 25% {transform:scale(1.0771183924324506);} + 30% {transform:scale(1.0780695942284886);} + 35% {transform:scale(1.081268381642509);} + 40% {transform:scale(1.0446864380239975);} + 45% {transform:scale(1.0822226558561991);} + 50% {transform:scale(1.0703574969484024);} + 55% {transform:scale(1.0131626458532954);} + 60% {transform:scale(1.0638351688496082);} + 65% {transform:scale(1.0254684750877292);} + 70% {transform:scale(1.0409969735315965);} + 75% {transform:scale(1.029863208069294);} + 80% {transform:scale(1.043175299252114);} + 85% {transform:scale(1.022196668538089);} + 90% {transform:scale(1.042465864842523);} + 95% {transform:scale(1.04090035265691);} + 100% {transform:scale(1.0385841106898348);} +} + +.torch { + position: absolute; + pointer-events: none; + opacity: 80%; + z-index: 50; +} \ No newline at end of file diff --git a/src/components/prehistoric-mode/prehistoric-mode.jsx b/src/components/prehistoric-mode/prehistoric-mode.jsx new file mode 100644 index 000000000..72a49d575 --- /dev/null +++ b/src/components/prehistoric-mode/prehistoric-mode.jsx @@ -0,0 +1,68 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import bindAll from 'lodash.bindall'; +import styles from './prehistoric-mode.css'; +import {connect} from 'react-redux'; +import {isTimeTravel220022BC} from '../../reducers/time-travel'; +import torch from './torch.gif'; + +class PrehistoricMode extends React.Component { + constructor (props) { + super(props); + bindAll(this, [ + 'handleMouseMove' + ]); + this.state = { + x: window.innerWidth / 2, + y: window.innerHeight / 2 + }; + } + + componentDidMount () { + document.addEventListener('pointermove', this.handleMouseMove); + } + + componentWillUnmount () { + document.removeEventListener('pointermove', this.handleMouseMove); + } + + handleMouseMove (event) { + this.setState({x: event.clientX, y: event.clientY}); + } + + render () { + if (!this.props.show) return null; + return ( +
+
+
+ ); + } +} + +PrehistoricMode.propTypes = { + show: PropTypes.bool +}; + +const mapStateToProps = state => ({ + // This is the button's mode, as opposed to the actual current state + show: isTimeTravel220022BC(state) +}); + +export default connect( + mapStateToProps +)(PrehistoricMode); diff --git a/src/components/prehistoric-mode/torch.gif b/src/components/prehistoric-mode/torch.gif new file mode 100644 index 000000000..6f5b13927 Binary files /dev/null and b/src/components/prehistoric-mode/torch.gif differ diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index 5756249f7..616d2e090 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -26,6 +26,7 @@ import {closeExtensionLibrary, openSoundRecorder, openConnectionModal} from '../ import {activateCustomProcedures, deactivateCustomProcedures} from '../reducers/custom-procedures'; import {setConnectionModalExtensionId} from '../reducers/connection-modal'; import {updateMetrics} from '../reducers/workspace-metrics'; +import {isTimeTravel2020} from '../reducers/time-travel'; import { activateTab, @@ -48,7 +49,7 @@ const DroppableBlocks = DropAreaHOC([ class Blocks extends React.Component { constructor (props) { super(props); - this.ScratchBlocks = VMScratchBlocks(props.vm); + this.ScratchBlocks = VMScratchBlocks(props.vm, false); bindAll(this, [ 'attachVM', 'detachVM', @@ -87,6 +88,11 @@ class Blocks extends React.Component { this.toolboxUpdateQueue = []; } componentDidMount () { + this.ScratchBlocks = VMScratchBlocks(this.props.vm, this.props.useCatBlocks); + this.ScratchBlocks.prompt = this.handlePromptStart; + this.ScratchBlocks.statusButtonCallback = this.handleConnectionModalStart; + this.ScratchBlocks.recordSoundCallback = this.handleOpenSoundRecorder; + this.ScratchBlocks.FieldColourSlider.activateEyedropper_ = this.props.onActivateColorPicker; this.ScratchBlocks.Procedures.externalProcedureDefCallback = this.props.onActivateCustomProcedures; this.ScratchBlocks.ScratchMsgs.setLocale(this.props.locale); @@ -553,6 +559,7 @@ class Blocks extends React.Component { onRequestCloseCustomProcedures, toolboxXML, updateMetrics: updateMetricsProp, + useCatBlocks, workspaceMetrics, ...props } = this.props; @@ -639,6 +646,7 @@ Blocks.propTypes = { toolboxXML: PropTypes.string, updateMetrics: PropTypes.func, updateToolboxState: PropTypes.func, + useCatBlocks: PropTypes.bool, vm: PropTypes.instanceOf(VM).isRequired, workspaceMetrics: PropTypes.shape({ targets: PropTypes.objectOf(PropTypes.object) @@ -689,7 +697,8 @@ const mapStateToProps = state => ({ messages: state.locales.messages, toolboxXML: state.scratchGui.toolbox.toolboxXML, customProceduresVisible: state.scratchGui.customProcedures.active, - workspaceMetrics: state.scratchGui.workspaceMetrics + workspaceMetrics: state.scratchGui.workspaceMetrics, + useCatBlocks: isTimeTravel2020(state) }); const mapDispatchToProps = dispatch => ({ diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index c10df0fb3..0081c83c5 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -104,6 +104,7 @@ GUI.propTypes = { isLoading: PropTypes.bool, isScratchDesktop: PropTypes.bool, isShowingProject: PropTypes.bool, + isTotallyNormal: PropTypes.bool, loadingStateVisible: PropTypes.bool, onProjectLoaded: PropTypes.func, onSeeCommunity: PropTypes.func, @@ -118,6 +119,7 @@ GUI.propTypes = { GUI.defaultProps = { isScratchDesktop: false, + isTotallyNormal: false, onStorageInit: storageInstance => storageInstance.addOfficialScratchWebStores(), onProjectLoaded: () => {}, onUpdateProjectId: () => {}, diff --git a/src/lib/blocks.js b/src/lib/blocks.js index 809a77ce2..bb9a94db3 100644 --- a/src/lib/blocks.js +++ b/src/lib/blocks.js @@ -1,12 +1,11 @@ -import ScratchBlocks from 'scratch-blocks'; - /** * Connect scratch blocks with the vm * @param {VirtualMachine} vm - The scratch vm + * @param {Bool} useCatBlocks - Whether to use cat blocks rendering of ScratchBlocks * @return {ScratchBlocks} ScratchBlocks connected with the vm */ -export default function (vm) { - +export default function (vm, useCatBlocks) { + const ScratchBlocks = useCatBlocks ? require('cat-blocks') : require('scratch-blocks'); const jsonForMenuBlock = function (name, menuOptionsFn, colors, start) { return { message0: '%1', diff --git a/src/reducers/gui.js b/src/reducers/gui.js index 378a3203c..bf9dda8fd 100644 --- a/src/reducers/gui.js +++ b/src/reducers/gui.js @@ -22,6 +22,7 @@ import restoreDeletionReducer, {restoreDeletionInitialState} from './restore-del import stageSizeReducer, {stageSizeInitialState} from './stage-size'; import targetReducer, {targetsInitialState} from './targets'; import timeoutReducer, {timeoutInitialState} from './timeout'; +import timeTravelReducer, {timeTravelInitialState} from './time-travel'; import toolboxReducer, {toolboxInitialState} from './toolbox'; import vmReducer, {vmInitialState} from './vm'; import vmStatusReducer, {vmStatusInitialState} from './vm-status'; @@ -56,6 +57,7 @@ const guiInitialState = { restoreDeletion: restoreDeletionInitialState, targets: targetsInitialState, timeout: timeoutInitialState, + timeTravel: timeTravelInitialState, toolbox: toolboxInitialState, vm: vmInitialState, vmStatus: vmStatusInitialState, @@ -155,6 +157,7 @@ const guiReducer = combineReducers({ restoreDeletion: restoreDeletionReducer, targets: targetReducer, timeout: timeoutReducer, + timeTravel: timeTravelReducer, toolbox: toolboxReducer, vm: vmReducer, vmStatus: vmStatusReducer, diff --git a/src/reducers/menus.js b/src/reducers/menus.js index fc3687f5a..b756a9e41 100644 --- a/src/reducers/menus.js +++ b/src/reducers/menus.js @@ -7,6 +7,7 @@ const MENU_FILE = 'fileMenu'; const MENU_EDIT = 'editMenu'; const MENU_LANGUAGE = 'languageMenu'; const MENU_LOGIN = 'loginMenu'; +const MENU_MODE = 'modeMenu'; const initialState = { @@ -15,7 +16,8 @@ const initialState = { [MENU_FILE]: false, [MENU_EDIT]: false, [MENU_LANGUAGE]: false, - [MENU_LOGIN]: false + [MENU_LOGIN]: false, + [MENU_MODE]: false }; const reducer = function (state, action) { @@ -59,6 +61,10 @@ const languageMenuOpen = state => state.scratchGui.menus[MENU_LANGUAGE]; const openLoginMenu = () => openMenu(MENU_LOGIN); const closeLoginMenu = () => closeMenu(MENU_LOGIN); const loginMenuOpen = state => state.scratchGui.menus[MENU_LOGIN]; +const openModeMenu = () => openMenu(MENU_MODE); +const closeModeMenu = () => closeMenu(MENU_MODE); +const modeMenuOpen = state => state.scratchGui.menus[MENU_MODE]; + export { reducer as default, @@ -80,5 +86,8 @@ export { languageMenuOpen, openLoginMenu, closeLoginMenu, - loginMenuOpen + loginMenuOpen, + openModeMenu, + closeModeMenu, + modeMenuOpen }; diff --git a/src/reducers/time-travel.js b/src/reducers/time-travel.js new file mode 100644 index 000000000..23cfe6cbe --- /dev/null +++ b/src/reducers/time-travel.js @@ -0,0 +1,96 @@ +const SET_TIME_TRAVEL = 'scratch-gui/time-travel/SET_TIME_TRAVEL'; +const initialState = { + year: 'NOW' +}; + +const NOW = 'NOW'; +const YEAR_2020 = '2020'; +const YEAR_1990 = '1990'; +const YEAR_1920 = '1920'; +const YEAR_220022BC = '220022BC'; + +const reducer = function (state, action) { + if (typeof state === 'undefined') state = initialState; + switch (action.type) { + case SET_TIME_TRAVEL: + return Object.assign({}, state, { + year: action.year + }); + default: + return state; + } +}; + +const isTimeTravel220022BC = function (state) { + return state.scratchGui.timeTravel.year === YEAR_220022BC; +}; +const setTimeTravel220022BC = function () { + return { + type: SET_TIME_TRAVEL, + year: YEAR_220022BC + }; +}; + +const isTimeTravel1920 = function (state) { + return state.scratchGui.timeTravel.year === YEAR_1920; +}; +const setTimeTravel1920 = function () { + return { + type: SET_TIME_TRAVEL, + year: YEAR_1920 + }; +}; + +const isTimeTravel1990 = function (state) { + return state.scratchGui.timeTravel.year === YEAR_1990; +}; +const setTimeTravel1990 = function () { + return { + type: SET_TIME_TRAVEL, + year: YEAR_1990 + }; +}; + + +const isTimeTravel2020 = function (state) { + return state.scratchGui.timeTravel.year === YEAR_2020; +}; +const setTimeTravel2020 = function () { + return { + type: SET_TIME_TRAVEL, + year: YEAR_2020 + }; +}; + +const isTimeTravelNow = function (state) { + return state.scratchGui.timeTravel.year === NOW; +}; +const setTimeTravelNow = function () { + return { + type: SET_TIME_TRAVEL, + year: NOW + }; +}; + +const setTimeTravel = function (mode) { + return { + type: SET_TIME_TRAVEL, + year: mode + }; +}; + +export { + reducer as default, + initialState as timeTravelInitialState, + isTimeTravel220022BC, + isTimeTravel1920, + isTimeTravel1990, + isTimeTravel2020, + isTimeTravelNow, + setTimeTravel220022BC, + setTimeTravel1920, + setTimeTravel1990, + setTimeTravel2020, + setTimeTravelNow, + setTimeTravel +}; diff --git a/test/unit/components/menu-bar.test.jsx b/test/unit/components/menu-bar.test.jsx index 3aaadb9de..6e3f1bd09 100644 --- a/test/unit/components/menu-bar.test.jsx +++ b/test/unit/components/menu-bar.test.jsx @@ -20,6 +20,9 @@ describe('MenuBar Component', () => { projectState: { loadingState: LoadingState.NOT_LOADED }, + timeTravel: { + year: 'NOW' + }, vm: new VM() } }); diff --git a/webpack.config.js b/webpack.config.js index 168faa396..815333b96 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -112,7 +112,7 @@ module.exports = [ module: { rules: base.module.rules.concat([ { - test: /\.(svg|png|wav|gif|jpg)$/, + test: /\.(svg|png|wav|mp3|gif|jpg)$/, loader: 'file-loader', options: { outputPath: 'static/assets/' @@ -187,7 +187,8 @@ module.exports = [ patterns: [ { from: 'extension-worker.{js,js.map}', - context: 'node_modules/scratch-vm/dist/web' + context: 'node_modules/scratch-vm/dist/web', + noErrorOnMissing: true } ] }) @@ -213,7 +214,7 @@ module.exports = [ module: { rules: base.module.rules.concat([ { - test: /\.(svg|png|wav|gif|jpg)$/, + test: /\.(svg|png|wav|mp3|gif|jpg)$/, loader: 'file-loader', options: { outputPath: 'static/assets/', @@ -235,7 +236,8 @@ module.exports = [ patterns: [ { from: 'extension-worker.{js,js.map}', - context: 'node_modules/scratch-vm/dist/web' + context: 'node_modules/scratch-vm/dist/web', + noErrorOnMissing: true } ] }),