Compare commits

..
Author SHA1 Message Date
Christopher Willis-Ford eeb5cfd930 Merge tag '0.1.0-prerelease.20190828224521' into scratch-desktop 2019-08-29 12:03:49 -07:00
Eric Rosenbaum 99bdad90d6 Merge pull request #5129 from LLK/hotfix/add-marian-sprite
[hotfix] Add Marian sprite and costumes
2019-08-28 12:14:35 -07:00
Eric Rosenbaum ff78f0bcb3 Merge pull request #5129 from LLK/hotfix/add-marian-sprite
[hotfix] Add Marian sprite and costumes
2019-08-28 13:38:51 -04:00
Eric Rosenbaum 8ba5ecbec0 Add Marian sprite and costumes 2019-08-28 10:14:28 -04:00
chrisgarrity a8c3eb5831 Merge pull request #5128 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1566984014
Update scratch-blocks to the latest version 🚀
2019-08-28 11:28:44 +01:00
chrisgarrity d3ecb7b725 Merge branch 'develop' into greenkeeper/scratch-blocks-0.1.0-prerelease.1566984014 2019-08-28 11:16:26 +01:00
chrisgarrity c2321f8fe9 Merge pull request #5127 from LLK/greenkeeper/scratch-l10n-3.5.20190827223456
Greenkeeper/scratch l10n 3.5.20190827223456
2019-08-28 11:14:40 +01:00
greenkeeper[bot] 018d451431 chore(package): update lockfile package-lock.json 2019-08-28 09:46:20 +00:00
greenkeeper[bot] 986d8360e2 chore(package): update scratch-blocks to version 0.1.0-prerelease.1566984014 2019-08-28 09:46:14 +00:00
greenkeeper[bot] 087b73540c chore(package): update lockfile package-lock.json 2019-08-27 22:43:52 +00:00
greenkeeper[bot] 02a3221a09 chore(package): update scratch-l10n to version 3.5.20190827223456
Closes #5112
2019-08-27 22:43:45 +00:00
DD Liu 16960b5941 Merge pull request #5119 from fsih/updateSvgRend
Update svg renderer
2019-08-23 11:55:36 -04:00
DD Liu 11ffda10e6 fix svg rend number 2019-08-23 11:33:55 -04:00
DD Liu a07b234745 update svg renderer 2019-08-22 16:55:51 -04:00
DD Liu 276bcb0b28 Merge pull request #5118 from fsih/updateVm
Update vm
2019-08-22 16:46:32 -04:00
DD Liu 4e1842134a Update vm 2019-08-22 16:33:56 -04:00
Paul Kaplan a76dcfa1f9 Merge pull request #5111 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190820171249
Update scratch-svg-renderer to the latest version 🚀
2019-08-20 15:14:26 -04:00
Paul Kaplan f2e4bc518e Merge pull request #5108 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190819154958
Update scratch-render to the latest version 🚀
2019-08-20 15:14:07 -04:00
greenkeeper[bot] 770b9db129 chore(package): update lockfile package-lock.json 2019-08-20 17:25:08 +00:00
greenkeeper[bot] 13c502d76d chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190820171249 2019-08-20 17:25:02 +00:00
greenkeeper[bot] c2785f6429 chore(package): update lockfile package-lock.json 2019-08-19 16:23:41 +00:00
greenkeeper[bot] 0e8b6d7290 chore(package): update scratch-render to version 0.1.0-prerelease.20190819154958 2019-08-19 16:23:36 +00:00
Paul Kaplan 5c1b806f2d Merge pull request #5106 from fsih/revertRender
Revert render to last good version
2019-08-19 11:00:20 -04:00
DD 146c5d19ad Revert render to last good version 2019-08-16 17:34:16 -04:00
Paul Kaplan 25611283c4 Merge pull request #5103 from zoebentley/imagine-if-video
Added the Imagine If video to Imagine If tutorial, and changed last step
2019-08-16 11:09:39 -04:00
Paul Kaplan ebc91adfb5 Merge pull request #5104 from zoebentley/portuguese-and-italian
Portuguese and italian
2019-08-16 11:05:01 -04:00
Zoë Bentley 4a19260911 Added Imagine If Wistia link to translate-video.js 2019-08-15 18:14:18 -04:00
Zoë Bentley e9880c4d17 Removed Imagine If video (supposed to be part of a different PR) 2019-08-15 18:06:45 -04:00
Zoë Bentley b2bf8605ae Added video links for Portuguese and Italian tutorials 2019-08-15 17:56:07 -04:00
Zoë Bentley 3f5e5fbc0e Reduced image size 2019-08-15 17:51:03 -04:00
Zoë Bentley ad1d7e2751 Added the Imagine If video to the Imagine If tutorial, and changed the last card 2019-08-15 17:43:55 -04:00
Benjamin Wheeler 98eee04712 Merge pull request #5097 from LLK/greenkeeper/scratch-l10n-3.5.20190813223429
Update scratch-l10n to the latest version 🚀
2019-08-14 17:54:21 -04:00
Paul Kaplan 593c3448eb Merge pull request #5092 from paulkaplan/fix-import-hang
Close importing after failing to import
2019-08-14 11:15:06 -04:00
greenkeeper[bot] 4e8e0d09b0 chore(package): update lockfile package-lock.json 2019-08-13 22:52:50 +00:00
greenkeeper[bot] 88210fb5cc chore(package): update scratch-l10n to version 3.5.20190813223429 2019-08-13 22:52:46 +00:00
chrisgarrity 0913c1134d Merge pull request #5094 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190813192748
Update scratch-vm to the latest version 🚀
2019-08-13 18:10:38 -04:00
picklesrus 0d4808748d Merge pull request #5096 from LLK/revert-5078-fix-duplicate-run
Revert "Fix duplicate running blocks by removing pointer-events: none"
2019-08-13 17:35:36 -04:00
picklesrus 907059be00 Revert "Fix duplicate running blocks by removing pointer-events: none" 2019-08-13 17:34:02 -04:00
Paul Kaplan 7ffe6d650f Merge pull request #5095 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1565724757
Update scratch-blocks to the latest version 🚀
2019-08-13 16:25:05 -04:00
greenkeeper[bot] 179b850837 chore(package): update lockfile package-lock.json 2019-08-13 19:46:02 +00:00
greenkeeper[bot] 72617e8e6d chore(package): update scratch-blocks to version 0.1.0-prerelease.1565724757 2019-08-13 19:45:49 +00:00
greenkeeper[bot] 149e50595b chore(package): update lockfile package-lock.json 2019-08-13 19:32:12 +00:00
greenkeeper[bot] c8c33755de chore(package): update scratch-vm to version 0.2.0-prerelease.20190813192748 2019-08-13 19:32:07 +00:00
chrisgarrity e9e07052f8 Merge pull request #5088 from chrisgarrity/export-custom-mimetype
Get the mime-type for the file from the blob
2019-08-13 15:22:58 -04:00
Karishma Chadha 3252a33a87 Merge pull request #5093 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190813154945
Greenkeeper/scratch render 0.1.0 prerelease.20190813154945
2019-08-13 13:19:35 -04:00
greenkeeper[bot] 00f0c009c7 chore(package): update lockfile package-lock.json 2019-08-13 15:52:42 +00:00
greenkeeper[bot] 0648950207 chore(package): update scratch-render to version 0.1.0-prerelease.20190813154945
Closes #4992
2019-08-13 15:52:37 +00:00
Paul Kaplan ab0ee830d8 Close importing after failing to import 2019-08-13 11:33:32 -04:00
Chris Garrity 8c94fef24c Get the mime-type for the file from the blob
Depends on the VM change that sets the mime-type
2019-08-12 15:32:30 -04:00
Paul Kaplan ec386be590 Merge pull request #5078 from LLK/fix-duplicate-run
Fix duplicate running blocks by removing pointer-events: none
2019-08-12 08:42:42 -04:00
DD Liu 0adf321455 Merge pull request #5071 from fsih/webpackResolver
Add webpack resolver to eslintrc so linter doesn't give false positive noUnresolved errors
2019-08-08 16:08:04 -04:00
Paul Kaplan d4d6dede94 Fix duplicate running blocks by removing pointer-events: none; 2019-08-08 15:16:55 -04:00
Ray Schamp 95abe8207d Merge pull request #5076 from LLK/revert-5017-fix-up-delete-button
Revert "Make delete button accessible"
2019-08-08 10:31:38 -04:00
Ray Schamp 445874cb9c Revert "Make delete button accessible" 2019-08-08 10:30:58 -04:00
DD Liu 829435d5e6 Resolve package lock conflict 2019-08-08 00:36:59 -04:00
DD Liu 6658158972 Merge branch 'develop' into webpackResolver 2019-08-08 00:35:46 -04:00
DD Liu 127aa38f58 use path.resolve for config 2019-08-08 00:26:51 -04:00
Colby Gutierrez-Kraybill 770f381f6c Merge pull request #5064 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190805150531
Update scratch-vm to the latest version 🚀
2019-08-07 23:13:15 -04:00
Paul Kaplan 90b71ce5e5 Merge pull request #5039 from paulkaplan/fix-context-menu-after-drag
Fix issue where context menu wouldn't come back after dragging
2019-08-07 15:59:28 -04:00
Paul Kaplan 6db27c7fd9 Merge pull request #5072 from LLK/greenkeeper/scratch-l10n-3.5.20190807144510
Update scratch-l10n to the latest version 🚀
2019-08-07 15:38:57 -04:00
DD Liu dfdb491c7b Merge pull request #5069 from fsih/updatePaint
Update paint
2019-08-07 12:00:52 -04:00
DD Liu 212a0a5a59 Update paint 2019-08-07 11:48:51 -04:00
greenkeeper[bot] 442a949e97 chore(package): update lockfile package-lock.json 2019-08-07 15:44:30 +00:00
greenkeeper[bot] bdcb54f8b1 chore(package): update scratch-l10n to version 3.5.20190807144510 2019-08-07 15:44:25 +00:00
DD Liu eb989d7b2e Add webpack resolver to eslintrc so linter doesnt give false positive noUnresolved errors 2019-08-06 16:05:06 -04:00
DD Liu f30eb26b6d Switch to rolled back dep 2019-08-06 15:03:13 -04:00
Paul Kaplan 468da6fcbf Merge pull request #5059 from paulkaplan/fix-save-after-recording
Fix saving after recording a sound
2019-08-06 12:21:53 -04:00
greenkeeper[bot] ae5068a411 chore(package): update lockfile package-lock.json 2019-08-05 15:38:06 +00:00
greenkeeper[bot] e9b4b61c5f chore(package): update scratch-vm to version 0.2.0-prerelease.20190805150531 2019-08-05 15:38:02 +00:00
Paul Kaplan 043cbec994 Merge pull request #5061 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1564769819
Update scratch-blocks to the latest version 🚀
2019-08-02 14:54:11 -04:00
greenkeeper[bot] 4e34d5ab55 chore(package): update lockfile package-lock.json 2019-08-02 18:19:49 +00:00
greenkeeper[bot] baf7427453 chore(package): update scratch-blocks to version 0.1.0-prerelease.1564769819 2019-08-02 18:19:45 +00:00
Paul Kaplan b07c645124 Fix saving after recording a sound 2019-08-02 09:31:53 -04:00
chrisgarrity 69b7eef768 Merge pull request #4926 from LLK/sound-lib-touch
Add play buttons to sound library tiles for touch
2019-08-02 08:39:48 -04:00
chrisgarrity 3feff9fea8 Merge pull request #5017 from chrisgarrity/fix-up-delete-button
Make delete button accessible
2019-08-02 08:39:27 -04:00
Ray Schamp e23ac95c2c Merge pull request #5057 from rschamp/lint-tests
Add Jest-specific linting rules
2019-08-01 13:03:12 -04:00
rschamp 3c6bfe0607 Add Jest-specific linting rules
Adding this caught a couple of important things:
- The sound integration tests have a `.only` in them
- The project-saver-hoc tests had two tests with the same description, causing possible confusion if that test broke
2019-08-01 11:31:01 -04:00
Chris Garrity 3701a4fb44 Refactor to separate container/component
Also noticed that Delete aria label was not localized.
2019-07-31 16:20:34 -04:00
Chris Garrity e2c2bd3927 remove callbacks 2019-07-31 15:38:30 -04:00
Karishma Chadha d7e338607a Merge pull request #5054 from LLK/greenkeeper/scratch-l10n-3.5.20190731161310
Update scratch-l10n to the latest version 🚀
2019-07-31 15:25:41 -04:00
greenkeeper[bot] 285c06df9c chore(package): update lockfile package-lock.json 2019-07-31 16:15:25 +00:00
greenkeeper[bot] 928fd2afab chore(package): update scratch-l10n to version 3.5.20190731161310 2019-07-31 16:15:21 +00:00
Chris Garrity ab1537dab4 Use classNames instead of ternary
Use the classNames feature to include/exclude a class based on a boolean instead of ternary operator
2019-07-31 12:05:16 -04:00
Chris Garrity 043e31a472 Refactor
* split play-button into container and component
* revised sound library tile:
  * play button in upper right
  * smaller sound icon (make the tile less loaded)
2019-07-31 12:05:16 -04:00
Chris Garrity 91f5c4910f refactor to create play-button for sound items
Play button doesn’t have a ‘touch-outside’ listener to stop sounds. That seems to be ok as other events cause the sound to stop.

Both handleClick and handleMouseDown are needed. Must use handleMouseDown for `preventDefault` to skip setting focus on the item. handleClick is needed to prevent the Click from propagating to the item and selecting it.
2019-07-31 12:05:16 -04:00
Chris Garrity 41cc11c32e Handle sound ending
Update UI play/stop button when the sound ends
2019-07-31 12:05:16 -04:00
Chris Garrity 6216e7dfa7 improve touch interactions
Play button is larger (easier to touch). Can both start and stop sounds.
Sound doesn’t restart on mouseEnter if the sound is already playing.
Sound stops if you move off play button

Missing: stop button does not revert to play button when the sound finishes.
2019-07-31 12:05:16 -04:00
Chris Garrity 8ff41a3986 revise styles
Checked with Carl and updated the style of the play button.
2019-07-31 12:05:16 -04:00
Chris Garrity f3d1a91533 Add play buttons to sound library tiles for touch
Add prop to library items to show a play button. If a play button is present the ‘play on hover’ only applies over the icon rather than the full tile.
2019-07-31 12:05:16 -04:00
Paul Kaplan a72a420bd3 Merge pull request #5053 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190731151656
Update scratch-vm to the latest version 🚀
2019-07-31 11:40:41 -04:00
greenkeeper[bot] 6df151d244 chore(package): update lockfile package-lock.json 2019-07-31 15:30:16 +00:00
greenkeeper[bot] 14fa71d7f7 chore(package): update scratch-vm to version 0.2.0-prerelease.20190731151656 2019-07-31 15:30:12 +00:00
Paul Kaplan d73f912944 Merge pull request #5043 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190730131442
Update scratch-vm to the latest version 🚀
2019-07-31 11:17:26 -04:00
Eric Rosenbaum 593d919d48 Merge pull request #5049 from ericrosenbaum/bugfix/remove-test-only
Remove test.only
2019-07-31 11:10:18 -04:00
Paul Kaplan d452607c7a Merge pull request #5045 from LLK/greenkeeper/chromedriver-76.0.0
Update chromedriver to the latest version 🚀
2019-07-31 11:05:23 -04:00
Paul Kaplan 5987562bcb Merge branch 'develop' into greenkeeper/chromedriver-76.0.0 2019-07-31 11:04:59 -04:00
Paul Kaplan 3fae69e035 Merge pull request #5051 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1564581595
Greenkeeper/scratch blocks 0.1.0 prerelease.1564581595
2019-07-31 11:03:32 -04:00
Paul Kaplan 6222c79bee Merge pull request #5048 from ericrosenbaum/bugfix/update-fade-icons
Update fade icons
2019-07-31 10:50:03 -04:00
Paul Kaplan e4ebd53e69 Merge pull request #5050 from paulkaplan/fix-recording-drag-firefox
Prevent default when dragging trim handles to prevent image drag
2019-07-31 10:49:20 -04:00
Paul Kaplan c855152e86 Prevent default when dragging trim handles to prevent image drag 2019-07-31 10:48:06 -04:00
Eric Rosenbaum fb22e42b59 Remove test.only 2019-07-31 10:47:37 -04:00
Eric Rosenbaum dce65e33a5 Update fade icons 2019-07-31 10:43:54 -04:00
Eric Rosenbaum 1259457ee4 Merge pull request #5047 from paulkaplan/fix-zero-trim-update
Do not update trimmers only if both have not changed
2019-07-31 10:41:03 -04:00
Paul Kaplan 4757bb73e4 Do not update trimmers only if both have not changed 2019-07-31 10:27:15 -04:00
greenkeeper[bot] 6453345577 chore(package): update lockfile package-lock.json 2019-07-31 14:13:06 +00:00
greenkeeper[bot] a931f0e7be chore(package): update scratch-blocks to version 0.1.0-prerelease.1564581595
Closes #5034
2019-07-31 14:13:02 +00:00
greenkeeper[bot] 5ec2c42e55 chore(package): update lockfile package-lock.json 2019-07-31 00:11:24 +00:00
greenkeeper[bot] f664b37b4b chore(package): update chromedriver to version 76.0.0 2019-07-31 00:11:20 +00:00
Eric Rosenbaum 7d1dfb67b7 Merge pull request #4974 from ericrosenbaum/feature/sound-editor-selection4
Sound editor update: selection-based editing
2019-07-30 15:27:04 -04:00
Eric Rosenbaum 6bbff14aa4 Update chromedriver 2019-07-30 15:09:27 -04:00
Eric Rosenbaum 58499cec73 Add integration test for sound editor keyboard shortcuts 2019-07-30 14:57:25 -04:00
Eric Rosenbaum 2890609053 Add unit test for audio effect adjustedTrim times 2019-07-30 11:38:52 -04:00
greenkeeper[bot] 416284afad chore(package): update lockfile package-lock.json 2019-07-30 13:17:38 +00:00
greenkeeper[bot] 73480840db chore(package): update scratch-vm to version 0.2.0-prerelease.20190730131442 2019-07-30 13:17:34 +00:00
Paul Kaplan 227d747c72 Fix gestureInProgress after dragEnd to return the correct value
Fixes #5031, which is happening because the gestureInProgress call is still returning true after a drag ends.
2019-07-29 15:52:15 -04:00
Eric Rosenbaum 6100e0f199 Add integration tests for copy/paste 2019-07-29 14:00:04 -04:00
DD Liu 5b1670f520 Merge pull request #5036 from fsih/svgRendTest
Roll forward scratch-svg-renderer
2019-07-29 12:22:13 -04:00
DD Liu f62f170226 update package-lock 2019-07-29 11:54:59 -04:00
DD Liu 7e38d9dd0c update paint 2019-07-29 11:45:29 -04:00
DD Liu 5cd13c3039 Update svg renderer 2019-07-29 11:45:05 -04:00
Christopher Willis-Ford 1f5ac6e383 add react-visibility-sensor to package-lock.json 2019-07-27 15:42:34 -07:00
Christopher Willis-Ford 9cb5f3f96d Merge tag '0.1.0-prerelease.20190725155313' into scratch-desktop 2019-07-27 15:31:18 -07:00
Chris Garrity 1b4b50b09a Make space and enter actually work if focused
If the delete button is the current active element (e.g. focused by tab) make hitting ‘space’ or ‘Enter’ do the actual delete.
2019-07-26 09:37:39 -04:00
Chris Garrity cd7b5d93ee fix focus styling
Don’t use default focus style it’s ugly.

Don’t allow the image to be dragged.
2019-07-26 09:36:16 -04:00
Eric Rosenbaum 1563f7892d Add a test for the copy to new button 2019-07-25 16:32:53 -04:00
Eric Rosenbaum 5472f0a3e9 Enable the accidentally disabled sound integration tests 2019-07-25 16:32:27 -04:00
Eric Rosenbaum 032cd5aa02 Use DragRecognizer in AudioTrimmer 2019-07-25 15:53:07 -04:00
Eric Rosenbaum b0dbe9e323 Flip copy to new button in RTL, and use a class for flipping buttons 2019-07-25 15:29:10 -04:00
Eric Rosenbaum 8f23093617 Update snapshot 2019-07-25 15:12:04 -04:00
Eric Rosenbaum afccf65157 Improve accuracy of waveform rendering 2019-07-25 15:10:13 -04:00
Eric Rosenbaum c215104522 Only deselect-outside if there’s a selection 2019-07-25 14:33:49 -04:00
Ray Schamp 68389c8e6f Merge pull request #5027 from chrisgarrity/remove-delete-slop
Remove touch slop
2019-07-25 11:52:02 -04:00
Chris Garrity d4201075d0 Remove touch slop 2019-07-25 11:47:21 -04:00
Ray Schamp 1f95ff0fb1 Merge pull request #5026 from chrisgarrity/fix-file-menu
Check for null child before cloning menu item
2019-07-25 11:26:35 -04:00
Chris Garrity dd0c3d7468 Check for null child before cloning menu item 2019-07-25 11:20:18 -04:00
Eric Rosenbaum 0b9969c412 Update snapshot 2019-07-24 17:11:36 -04:00
Eric Rosenbaum d8df13a12c Prevent selection from moving when handles cross over 2019-07-24 17:02:54 -04:00
Eric Rosenbaum f28b6d8e00 Make the waveform rendering more precisely positioned 2019-07-24 17:01:56 -04:00
Eric Rosenbaum c23e4c4611 Improve effect button active state padding 2019-07-24 15:03:40 -04:00
Eric Rosenbaum bc3e69d047 Prevent dragging img in trimmer handles on firefox 2019-07-24 14:08:36 -04:00
Eric Rosenbaum aaa9c355e9 Use svgs w/o masks to prevent blurriness on safari 2019-07-24 14:02:20 -04:00
Ray Schamp c1dcbb0997 Merge pull request #5023 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1563990552
Update scratch-blocks to version 0.1.0-prerelease.1563990552
2019-07-24 13:53:46 -04:00
greenkeeper[bot] bc501cede2 chore(package): update lockfile package-lock.json 2019-07-24 17:51:57 +00:00
greenkeeper[bot] c243fa9c23 chore(package): update scratch-blocks to version 0.1.0-prerelease.1563990552
Closes #5008
2019-07-24 17:51:54 +00:00
Ray Schamp 765a5d3b95 Merge pull request #5020 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190724154115
Update scratch-paint to the latest version 🚀
2019-07-24 13:49:35 -04:00
chrisgarrity 351c0ba9b1 Merge pull request #5022 from LLK/greenkeeper/scratch-l10n-3.5.20190724160319
Greenkeeper/scratch l10n 3.5.20190724160319
2019-07-24 12:42:02 -04:00
greenkeeper[bot] ac30e17222 chore(package): update lockfile package-lock.json 2019-07-24 16:05:41 +00:00
greenkeeper[bot] bcdb2d5f3c chore(package): update scratch-l10n to version 3.5.20190724160319
Closes #5019
2019-07-24 16:05:37 +00:00
Eric Rosenbaum 6e5f378633 Prevent buffer detach issues with copy/paste on firefox 2019-07-24 12:05:27 -04:00
greenkeeper[bot] e70a99e52d chore(package): update lockfile package-lock.json 2019-07-24 15:43:19 +00:00
greenkeeper[bot] c6230ffc66 chore(package): update scratch-paint to version 0.2.0-prerelease.20190724154115 2019-07-24 15:43:15 +00:00
Karishma Chadha edaf9badcf Merge pull request #5013 from LLK/hotfix/revert-vm-raise-params-pr
Hotfix/revert vm raise params pr
2019-07-24 11:35:02 -04:00
Eric Rosenbaum 24d2e344e5 Prevent default on keyboard shortcuts 2019-07-24 11:31:20 -04:00
Eric Rosenbaum 79a819989f Prevent img drag and select issues 2019-07-24 11:22:25 -04:00
Eric Rosenbaum d882d180a5 Use separate play and stop icons for sound editor 2019-07-24 11:07:10 -04:00
Eric Rosenbaum 6be4e5e122 Fix mirroring of effect icons for RTL 2019-07-23 18:00:38 -04:00
Eric Rosenbaum 75dbed61fa Fix bug where play after paste used old selection state 2019-07-23 17:51:46 -04:00
chrisgarrity c4122ec03f Merge pull request #4960 from chrisgarrity/customize-menubar
Customize menubar
2019-07-23 16:32:35 -04:00
Eric Rosenbaum 0f17157a3d Update tests without echo effect 2019-07-23 16:14:56 -04:00
Eric Rosenbaum 5d2287b0b5 Use DragRecognizer to fix draggging on touch 2019-07-23 16:05:29 -04:00
Eric Rosenbaum c9ec59dc8a Remove unused icon 2019-07-23 15:37:00 -04:00
Eric Rosenbaum 3ab1b8254b Fix tool button styles 2019-07-23 15:29:03 -04:00
Eric Rosenbaum bf5b05e63f Re-order effects buttons and remove echo 2019-07-23 15:00:35 -04:00
Eric Rosenbaum 0eacc4b718 Prevent undo button layout from breaking 2019-07-23 15:00:22 -04:00
Eric Rosenbaum e1100f975c Fix handle div position 2019-07-23 14:48:22 -04:00
Eric Rosenbaum da4b492e08 Show trim handles over the edge of the asset panel 2019-07-23 14:21:18 -04:00
chrisgarrity 288aa721b6 Merge pull request #4915 from chrisgarrity/4911-delete-icon
Add larger delete icon to make it easier to do on touch devices
2019-07-23 11:40:56 -04:00
Eric Rosenbaum 324f3a6687 styles for trim handles and play button 2019-07-23 11:08:05 -04:00
Eric Rosenbaum d9409f0f0c Cleanup test 2019-07-22 17:48:25 -04:00
Eric Rosenbaum 40dc8487f4 Fix off-by-one error in reverse effect, add a test 2019-07-22 17:47:44 -04:00
Eric Rosenbaum bbe72e3485 Remove extra spaces 2019-07-22 16:10:31 -04:00
Eric Rosenbaum d6f2b0a48a Clean up AudioEffects constructor (needs a refactor) 2019-07-22 16:05:08 -04:00
Eric Rosenbaum e74255cf10 Use static getters for echo params 2019-07-22 15:07:34 -04:00
Karishma Chadha dd2841f349 More package-lock updates 2019-07-22 14:15:59 -04:00
Eric Rosenbaum 3823dd0629 Remove unused prop 2019-07-22 13:56:00 -04:00
Eric Rosenbaum 056da9ab94 Use offline context to create offline nodes 2019-07-22 13:55:49 -04:00
Karishma Chadha c9808e0eee Update vm to pull in PR reversion causing custom procedures regression 2019-07-22 13:54:56 -04:00
Chris Garrity 6bf9fac393 addressing comments
* add scratchLogo as default for logo prop
* prefer `{featureAllowed && (<Component />)} over ternary operator with a null ‘else’
* renamed `handleSaveToComputer` as `getSaveToComputerHandler` to more clearly represent what it’s doing (returning a function to be the handler)
* renamed the parameter that is the function to handle clicking on the load project menu item (also updated the comments in `SBFileUploader`)
2019-07-22 12:25:43 -04:00
Chris Garrity 6d482fdd5e Allow customized logo
Show alternate logo if GUI is initialized with a different file.
2019-07-22 12:05:04 -04:00
Chris Garrity 48c50692fc Add flags for language and file menus
Show or hide the language and file menus.
2019-07-22 12:05:04 -04:00
Chris Garrity 4e47cc875a Cleanup
* removed commented out cruft
* added tabIndex prop to delete button (with default=0)
* the last change also required a change to the sprite selector test snapshot
2019-07-22 12:02:14 -04:00
Chris Garrity 415ecee8ba Update tests 2019-07-22 12:02:14 -04:00
Chris Garrity d1e6960cd4 Modify tile delete button for touch
Prototype of larger delete button for sprites, costumes and sounds to better support touch devices.

I split it out from `CloseButton` as it made the changes simpler, and we may end up going in a different direction (open context menu).
2019-07-22 12:02:14 -04:00
chrisgarrity f2ac39fe0e Merge pull request #5010 from chrisgarrity/fix-package-lock
fix package-lock (revert svg-renderer) version
2019-07-22 11:34:04 -04:00
Chris Garrity 8e67cd413a fix package-lock (revert svg-renderer) version
*
2019-07-22 11:30:28 -04:00
Ray Schamp 4418231892 Merge pull request #4983 from rschamp/fix-browserslist-warning
Move browsers options to .browserslistrc
2019-07-22 10:14:44 -04:00
Christopher Willis-Ford 09b14ed4d4 expose TitledHOC for use with Scratch Desktop 2019-07-18 14:37:55 -07:00
DD Liu 8eee001c12 Merge pull request #5003 from fsih/updatePaint
Update paint to revert svg-renderer
2019-07-18 14:11:55 -04:00
DD Liu a290fb0227 Update paint to revert svg-renderer 2019-07-18 14:01:50 -04:00
DD Liu 42ddb2387a Merge pull request #5002 from fsih/revertSvgRend
Revert to last good scratch-svg-renderer
2019-07-18 13:38:37 -04:00
DD Liu 1e51907e74 Revert to last good scratch-svg-renderer 2019-07-18 13:36:57 -04:00
picklesrus 568a75480f Merge pull request #4996 from LLK/greenkeeper/scratch-l10n-3.3.20190717144934
Update scratch-l10n to the latest version 🚀
2019-07-17 16:32:44 -04:00
picklesrus 460a0f1969 Merge pull request #4997 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190717201758
Update scratch-vm to the latest version 🚀
2019-07-17 16:32:09 -04:00
greenkeeper[bot] 8d4f86dc3b chore(package): update lockfile package-lock.json 2019-07-17 20:20:51 +00:00
greenkeeper[bot] 56f9f02798 chore(package): update scratch-vm to version 0.2.0-prerelease.20190717201758 2019-07-17 20:20:48 +00:00
greenkeeper[bot] abf1b731bd chore(package): update scratch-l10n to version 3.3.20190717144934 2019-07-17 14:51:21 +00:00
Eric Rosenbaum 5062518d16 Fix playhead CSS 2019-07-16 16:41:36 -04:00
Eric Rosenbaum df7e77c865 Localize button titles 2019-07-16 16:14:28 -04:00
Eric Rosenbaum f0a18d3fd3 Extract selection handle and playhead components from trimmer and selector 2019-07-16 16:00:43 -04:00
Benjamin Wheeler 8dade6d387 Merge pull request #4985 from LLK/greenkeeper/react-modal-3.9.1
Update react-modal to the latest version 🚀
2019-07-16 15:45:21 -04:00
DD Liu 73eb44c0f6 Merge pull request #4989 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190715153806
Greenkeeper/scratch svg renderer 0.2.0 prerelease.20190715153806
2019-07-15 15:39:38 -04:00
DD Liu b190d29d46 Merge branch 'develop' into greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190715153806 2019-07-15 15:05:25 -04:00
DD Liu f858590358 Merge pull request #4991 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190715183326
Update scratch-paint to the latest version 🚀
2019-07-15 15:01:32 -04:00
greenkeeper[bot] 0795c511de chore(package): update lockfile package-lock.json 2019-07-15 18:35:08 +00:00
greenkeeper[bot] de678d8663 chore(package): update scratch-paint to version 0.2.0-prerelease.20190715183326 2019-07-15 18:35:05 +00:00
DD Liu 5c60052775 Merge branch 'develop' into greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190715153806 2019-07-15 14:30:04 -04:00
Andrew Sliwinski a0edb49c0a Merge pull request #4990 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190715155430
Greenkeeper/scratch paint 0.2.0 prerelease.20190715155430
2019-07-15 12:27:33 -04:00
Andrew Sliwinski 1282f659f9 Merge pull request #4986 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190715144356
Update scratch-vm to the latest version 🚀
2019-07-15 12:27:21 -04:00
greenkeeper[bot] f7b91a79e6 chore(package): update lockfile package-lock.json 2019-07-15 16:11:52 +00:00
greenkeeper[bot] 426546c36e chore(package): update scratch-paint to version 0.2.0-prerelease.20190715155430
Closes #4988
2019-07-15 16:11:48 +00:00
greenkeeper[bot] 404d9ed65f chore(package): update lockfile package-lock.json 2019-07-15 16:11:22 +00:00
greenkeeper[bot] 753aebdba7 chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190715153806
Closes #4987
2019-07-15 16:11:18 +00:00
Eric Rosenbaum 2659490a70 Update snapshot 2019-07-15 12:00:27 -04:00
Eric Rosenbaum cff0b17881 Combine CSS for trimmer and selector into single file 2019-07-15 11:40:10 -04:00
greenkeeper[bot] 9d4218531b chore(package): update lockfile package-lock.json 2019-07-15 15:04:03 +00:00
greenkeeper[bot] b56020be3e chore(package): update scratch-vm to version 0.2.0-prerelease.20190715144356 2019-07-15 15:03:59 +00:00
greenkeeper[bot] b5c5e28b59 chore(package): update lockfile package-lock.json 2019-07-14 16:53:10 +00:00
greenkeeper[bot] 8a2bcb3f53 chore(package): update react-modal to version 3.9.1 2019-07-14 16:53:07 +00:00
Ray Schamp e5ae5b7035 Merge pull request #4981 from LLK/greenkeeper/initial
Update dependencies to enable Greenkeeper 🌴
2019-07-11 14:08:32 -04:00
Ray Schamp 413df6ed65 Move browsers options to .browserslistrc
Apparently this is the recommendation for loaders that look at the `browsers` option.
2019-07-11 14:00:24 -04:00
Ray Schamp 0ec46056f0 Add package-lock to repo 2019-07-11 13:53:31 -04:00
Ray Schamp 9dcb1f8126 Revert "chore(package): update dependencies"
This reverts commit 4e9c8aea01.
2019-07-11 13:48:28 -04:00
greenkeeper[bot] 4e9c8aea01 chore(package): update dependencies 2019-07-11 14:44:45 +00:00
DD Liu 7d748ce59d Merge pull request #4980 from fsih/updatel10n
Update l10n
2019-07-10 21:11:01 -04:00
DD Liu 198cf00498 update l10n 2019-07-10 21:10:07 -04:00
DD Liu 145592b2e1 Merge pull request #4979 from fsih/unupdateScratchDeps
Revert to last good render
2019-07-10 20:31:15 -04:00
DD Liu 6fe8f7b2ec revert to last good render 2019-07-10 20:11:03 -04:00
DD Liu 3cbfa7cfc3 Merge pull request #4978 from fsih/updateScratchDeps
Update deps
2019-07-10 19:57:33 -04:00
DD Liu 30a35d7651 Update deps 2019-07-10 19:53:57 -04:00
Eric Rosenbaum c46069759a Cleanup and lint fixes 2019-07-09 17:45:25 -04:00
Eric Rosenbaum 68a4284e8c Add util for encodeAndAddSoundToVM 2019-07-09 17:33:33 -04:00
Eric Rosenbaum c11624ab06 Fix tests and remove unused icons 2019-07-09 17:23:20 -04:00
Eric Rosenbaum 91c81131d8 Add keyboard shortcuts 2019-07-09 15:32:30 -04:00
Eric Rosenbaum ee44e225f5 Icon button styling 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 0a489ea2ea Add copy, paste, copy to new and delete buttons 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 1e147e4397 Fix tests 2019-07-09 15:32:29 -04:00
Eric Rosenbaum c11b4a34ef Protect effects from error due to very short sound 2019-07-09 15:32:29 -04:00
Eric Rosenbaum e5a517a325 Include selection state in undo/redo stack 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 7bbe5f0589 Add fade in, fade out and mute effects 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 8f949f532f Apply effects to selection 2019-07-09 15:32:29 -04:00
Eric Rosenbaum f71a481d0e Remove icons not yet in use 2019-07-09 15:32:29 -04:00
Eric Rosenbaum fdd4b61d5d Revert and fix tests
This reverts commit 42ff50300cff7558fd03cdebb757eca8caf85199.
2019-07-09 15:32:29 -04:00
Eric Rosenbaum b34e1c69f0 Cleanup and connect trim button to delete 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 64562a8a05 Selection and delete 2019-07-09 15:32:29 -04:00
Eric Rosenbaum 0d88c7755b Update tests 2019-07-09 15:32:28 -04:00
Eric Rosenbaum 7704bafb00 Add icons 2019-07-09 15:32:28 -04:00
Paul Kaplan ab31d36251 Merge pull request #4962 from LLK/hotfix/2019-07-02
Correctly fail on non-200 responses when saving
2019-07-08 13:05:14 -04:00
Paul Kaplan 7362bd999c Respond to non-200 responses when saving 2019-07-02 12:32:27 -04:00
Paul Kaplan b4a0879584 Merge pull request #4953 from LLK/paulkaplan-patch-1
Bump l10n version
2019-06-26 13:59:33 -04:00
Paul Kaplan 8274a8c6c7 Bump l10n version 2019-06-26 13:59:19 -04:00
Paul Kaplan cdffd567b6 Merge pull request #4952 from LLK/paulkaplan-patch-1
Update blocks manually
2019-06-26 12:59:22 -04:00
Paul Kaplan c7003b4765 Update blocks manually
Seems like greenkeeper isn't keeping up?
2019-06-26 12:57:58 -04:00
Paul Kaplan 4e3f2160ae Merge pull request #4938 from LLK/touch-share
Allow sharing blocks/costumes/sounds on touch devices
2019-06-26 12:55:33 -04:00
Paul Kaplan 095fea939d Merge pull request #4941 from paulkaplan/proper-keys
Fix library images lagging behind filter changes
2019-06-26 12:53:44 -04:00
Paul Kaplan 26e4bc2ad2 Fix merge conflicts 2019-06-26 10:56:54 -04:00
Paul Kaplan 18241a5cbd Merge branch 'develop' into touch-share 2019-06-26 10:35:13 -04:00
Paul Kaplan d8cd3e38c7 Merge pull request #4931 from paulkaplan/fix-wistia-crash
Prevent crash when wistia API takes a while to load
2019-06-26 10:28:32 -04:00
Christopher Willis-Ford 5859af7efa Merge tag '0.1.0-prerelease.20190624143137' into scratch-desktop 2019-06-24 11:10:17 -07:00
Paul Kaplan 0bbb11012d Merge pull request #4935 from LLK/drag-angle
Allow vertical scrolling of sprite tile pane on touch devices
2019-06-24 14:05:32 -04:00
Paul Kaplan 212c998980 Merge pull request #4947 from LLK/update-paint
Bump scratch-paint version
2019-06-24 10:30:36 -04:00
Paul Kaplan e359efd97e Merge pull request #4948 from LLK/paulkaplan-patch-1
Fix PropType on Loupe component
2019-06-24 10:30:19 -04:00
Paul Kaplan 547640bfcc Add sprite prop to proptypes 2019-06-24 10:11:17 -04:00
Paul Kaplan d7a2264c0d Fix proptypes on Loupe component 2019-06-24 09:57:17 -04:00
Paul Kaplan 0bb91add74 Bump scratch-paint version 2019-06-24 09:42:09 -04:00
Paul Kaplan cea2dd9ab9 Fix spacing 2019-06-21 09:45:23 -04:00
Paul Kaplan c424f25da1 Fix proptypes 2019-06-21 09:33:26 -04:00
Paul Kaplan 7c1931749c Use name or url for library keys 2019-06-21 09:19:43 -04:00
Paul Kaplan 4708ccc7dc Be defensive about using the Wistia API 2019-06-21 09:19:18 -04:00
Paul Kaplan 9e0a239ec8 Merge pull request #4932 from paulkaplan/fix-tutorial-image-sync
Prevent previous tutorial images from hanging around on next/prev
2019-06-21 09:05:28 -04:00
Paul Kaplan 8a2c001531 Merge pull request #4921 from paulkaplan/on-vm-init
Add VM init callback
2019-06-21 09:05:10 -04:00
Paul Kaplan 044b958e08 Add vm init callback 2019-06-21 08:48:53 -04:00
Paul Kaplan a2bbed65d5 Force img node change to prevent previous tutorial images from hanging around 2019-06-21 08:41:01 -04:00
picklesrus cf62045e26 Merge pull request #4942 from LLK/revert-4940-revert-4790
Revert "Revert "Merge pull request #4790 from LLK/e16n""
2019-06-20 17:53:23 -04:00
chrisgarrity 164ddbe4f4 Revert "Revert "Merge pull request #4790 from LLK/e16n"" 2019-06-20 17:12:59 -04:00
picklesrus 6b5eb032ad Merge pull request #4940 from picklesrus/revert-4790
Revert "Merge pull request #4790 from LLK/e16n"
2019-06-20 11:40:30 -04:00
picklesrus 8d3a85860e Revert "Merge pull request #4790 from LLK/e16n"
This reverts commit c061f2e2f0, reversing
changes made to 6e007b1e4a.
2019-06-20 11:21:56 -04:00
Benjamin Wheeler cbb265e9f0 Merge pull request #4934 from benjiwheeler/remove-example-test
skip example change categories test
2019-06-19 18:13:05 -04:00
Eric Rosenbaum 948fb2f747 Merge pull request #4937 from zoebentley/tutorial-updates
Make Updates to Tutorials Library
2019-06-19 16:54:05 -04:00
Zoë Bentley b0ca6dfcaa Lint 2019-06-19 16:22:34 -04:00
Zoë Bentley 61eb31ea66 Optimize .png images 2019-06-19 15:53:48 -04:00
Paul Kaplan eed4c36b7b Emit hover on touch end to make sharing to sprites work on touch 2019-06-19 15:41:59 -04:00
Zoë Bentley b5a3a53780 Added 3 new tutorials, added pngs to tutorials that only had videos, reordered tutorials in library 2019-06-19 15:22:50 -04:00
Eric Rosenbaum a6302ecc14 Merge pull request #4936 from LLK/ericrosenbaum-patch-1
Update l10n
2019-06-19 15:04:01 -04:00
Eric Rosenbaum 2a9d74adb4 Update l10n 2019-06-19 14:45:01 -04:00
Eric Rosenbaum e5772a5902 Merge pull request #4922 from ericrosenbaum/feature/acw-assets
Updates to sprite and costume libraries
2019-06-19 11:36:51 -04:00
Paul Kaplan abdeb8dbdb Fix context menu coming up when dragging 2019-06-19 11:27:00 -04:00
Paul Kaplan 8611c9ff1a Refactor gesture recognizer with tests 2019-06-19 11:26:42 -04:00
Ben Wheeler f7244e6c89 skip example change categories test 2019-06-19 11:25:07 -04:00
Paul Kaplan 4b7f72c00c Only start tile drag for certain angles 2019-06-19 09:22:05 -04:00
Christopher Willis-Ford 1476c88a54 update VM for non-droppable extension menu support 2019-06-18 21:27:42 -07:00
Chris Willis-Ford c061f2e2f0 Merge pull request #4790 from LLK/e16n
Supporting GUI changes for extensionification
2019-06-18 16:22:25 -07:00
Chris Willis-Ford dc49c0ebe4 Merge branch 'develop' into e16n 2019-06-18 16:06:46 -07:00
Christopher Willis-Ford 11d4273982 update VM to an e16n-compatible version 2019-06-18 16:02:28 -07:00
Christopher Willis-Ford 7755f76215 simplify MockBlock construction 2019-06-18 14:15:43 -07:00
Christopher Willis-Ford 6e44bfea95 fix lint errors in define-dynamic-block.test.js 2019-06-18 11:37:17 -07:00
Christopher Willis-Ford fa8ceacbcf add comments suggested in code review 2019-06-18 11:31:53 -07:00
Christopher Willis-Ford d19c468336 allow per-block colors 2019-06-18 11:24:29 -07:00
Chris Willis-FordandKarishma Chadha 86edd829c0 Apply suggestions from code review
Comments slightly tweaked from kchadha's suggestions

Co-Authored-By: Karishma Chadha <kchadha@media.mit.edu>
2019-06-18 11:21:03 -07:00
Eric Rosenbaum bdc9c1e7de Update sprite and costume libraries 2019-06-17 17:56:28 -04:00
chrisgarrity 6e007b1e4a Merge pull request #4917 from chrisgarrity/update-l10n
Update l10n to the latest version
2019-06-12 12:05:32 -04:00
Chris Garrity 356c1d9811 Update l10n to the latest version 2019-06-12 11:47:38 -04:00
picklesrus 723a2bf117 Merge pull request #4913 from LLK/picklesrus-patch-1
Update scratch-vm
2019-06-10 13:22:50 -04:00
picklesrus 7b7e5e6e72 Update scratch-vm
Greenkeeper didn't do this for me... not sure why.
2019-06-10 11:59:41 -04:00
Paul Kaplan 3fcbf74c71 Merge pull request #4909 from LLK/progressive-libraries
Show libraries before loading their content
2019-06-10 09:29:56 -04:00
Christopher Willis-Ford d4e71024fb Merge tag '0.1.0-prerelease.20190605201216' into scratch-desktop 2019-06-09 22:14:49 -07:00
Paul Kaplan 8f4a6ce255 Fix proptype sorting 2019-06-07 09:19:26 -04:00
Paul Kaplan 9e0853aa9a Merge branch 'develop' of github.com:LLK/scratch-gui into progressive-libraries 2019-06-07 09:06:39 -04:00
Paul Kaplan c4480b9ade Show spinner before loading library content 2019-06-07 09:05:56 -04:00
Paul Kaplan 1a588880bf Merge pull request #4901 from paulkaplan/no-videos-on-desktop
Use a "title card" instead of video if using Scratch Desktop
2019-06-05 16:10:16 -04:00
Paul Kaplan e2c2392a70 Only show items in the library that would have image steps for offline
Because the video steps get replaced by an image step if offline, we should not show items that would result in having no content
2019-06-05 15:09:28 -04:00
Paul Kaplan 5160b5ae22 Make the cards images all the same size, and shrink to fit centered 2019-06-05 15:08:32 -04:00
Karishma Chadha 8be847b68a Merge pull request #4904 from LLK/kchadha-update-render
Update scratch-render
2019-06-05 14:51:29 -04:00
Karishma Chadha e7ed24f1ef Update scratch-render 2019-06-05 14:50:57 -04:00
Paul Kaplan 13e324b52d Use title card instead of video if using scratchDesktop flag 2019-06-05 12:53:32 -04:00
Karishma Chadha 5c7b221799 Merge pull request #4900 from LLK/kchadha-update-deps
Update scratch-vm and scratch-l10n.
2019-06-05 11:51:25 -04:00
Karishma Chadha 7398a30223 Update scratch-vm and scratch-l10n. 2019-06-05 11:34:33 -04:00
Paul Kaplan 637b9fd225 Merge pull request #4832 from paulkaplan/do-not-select-stage
Make surprise and library backdrop additions NOT select the stage
2019-06-05 10:45:34 -04:00
Benjamin Wheeler 88442708c2 Merge pull request #4883 from benjiwheeler/fix-project-loading-tests
fixed project loading tests
2019-06-05 10:35:26 -04:00
Paul Kaplan d7759317c4 Merge pull request #4896 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190604153446
chore(package): update scratch-vm to version 0.2.0-prerelease.2019060…
2019-06-04 14:10:38 -04:00
Ben Wheeler fd3045eb9d also turn off examples tests that load remote project 2019-06-04 11:40:03 -04:00
greenkeeper[bot] 09ae22f329 chore(package): update scratch-vm to version 0.2.0-prerelease.20190604153446
Closes #4894
2019-06-04 15:37:41 +00:00
Benjamin Wheeler 365e3b3bce Merge pull request #4881 from LLK/revert-4877-revert-4835-bugfix/4766
Revert "Revert "Pause video on tutorial window shrink""
2019-06-03 16:16:01 -04:00
Christopher Willis-Ford a6fe8585fb add unit tests for defineDynamicBlock 2019-06-03 13:04:15 -07:00
Christopher Willis-Ford 930b2ec05c setOutput takes a Boolean, not a type 2019-06-03 13:04:15 -07:00
Christopher Willis-Ford c9d1535967 move defineDynamicBlock into its own file 2019-06-03 13:04:15 -07:00
Evelyn Eastmond 550849c93f Reset video if a new one has been chosen. Added some comments. 2019-05-30 22:03:56 -04:00
Ben Wheeler 8128902cd6 fixed project loading test 2019-05-30 18:52:33 -04:00
Evelyn Eastmond b350049ca7 Testing a commit onto upstream branch for revert PR. 2019-05-30 17:17:01 -04:00
Evelyn Eastmond e0e07929e8 Revert "Revert "Pause video on tutorial window shrink"" 2019-05-30 17:10:58 -04:00
Benjamin Wheeler 128b196220 Merge pull request #4878 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190530160621
Update scratch-render to the latest version 🚀
2019-05-30 12:23:54 -04:00
greenkeeper[bot] 5b806dff27 chore(package): update scratch-render to version 0.1.0-prerelease.20190530160621 2019-05-30 16:13:40 +00:00
Benjamin Wheeler 9c5d358c3e Merge pull request #4877 from LLK/revert-4835-bugfix/4766
Revert "Pause video on tutorial window shrink"
2019-05-30 12:01:22 -04:00
Benjamin Wheeler ab89ee1a4f Revert "Pause video on tutorial window shrink" 2019-05-30 11:59:45 -04:00
Paul Kaplan dc82e5f653 Merge pull request #4873 from LLK/revert-4800-delay-gui
Revert "Delay loading and rendering gui"
2019-05-30 11:35:57 -04:00
Paul Kaplan 7fb3a81a66 Merge pull request #4874 from LLK/revert-4677-update-toolbox
Revert "render only new toolbox xmls"
2019-05-30 11:31:30 -04:00
Paul Kaplan d958b14b8d Revert "render only new toolbox xmls" 2019-05-30 10:50:41 -04:00
Paul Kaplan 0a6c75eb93 Revert "Delay loading and rendering gui" 2019-05-30 09:41:05 -04:00
Colby Gutierrez-Kraybill 7c5a4fc682 Merge pull request #4870 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190524155459
chore(package): update scratch-vm to version 0.2.0-prerelease.2019052…
2019-05-29 15:46:39 -04:00
Bryce Taylor ca8caa8504 Merge pull request #4871 from BryceLTaylor/Stabilize-Integration-Tests
Stabilize integration tests
2019-05-29 15:40:02 -04:00
Benjamin Wheeler 339dfe0b08 Merge pull request #4846 from paulkaplan/update-builtin-assets
Update the built-in SVG assets for the default project
2019-05-29 15:11:15 -04:00
BryceLTaylor b9cefd325b Remove unused reference to findByText in integration tests 2019-05-29 14:45:57 -04:00
BryceLTaylor fa974c68bd Remove WaitUntilGone function from integration tests
These were causing the tests to fail and should be fixed by the update to FindByXpath function.
2019-05-29 14:23:50 -04:00
BryceLTaylor 3c47e0e040 Make Find by Xpath ensure element is visible in integration tests 2019-05-29 14:23:50 -04:00
Colby Gutierrez-Kraybill 34a9a97201 Merge pull request #4868 from LLK/greenkeeper/scratch-l10n-3.3.20190529144051
Update scratch-l10n to the latest version 🚀
2019-05-29 13:23:10 -04:00
Colby Gutierrez-Kraybill f6847e3aea Merge branch 'develop' into greenkeeper/scratch-l10n-3.3.20190529144051 2019-05-29 13:08:47 -04:00
Evelyn Eastmond e27021cbf4 Merge pull request #4835 from evhan55/bugfix/4766
Pause video on tutorial window shrink
2019-05-29 12:39:50 -04:00
Colby Gutierrez-Kraybill 3dc6413ea4 Merge pull request #4867 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1559136797
Update scratch-blocks to the latest version 🚀
2019-05-29 11:38:53 -04:00
greenkeeper[bot] 53c04a1ad9 chore(package): update scratch-l10n to version 3.3.20190529144051 2019-05-29 14:45:06 +00:00
Evelyn Eastmond b2486380fb Disable dragging on video to allow for scrobbling. 2019-05-29 09:46:08 -04:00
greenkeeper[bot] 9f41ddaaa2 chore(package): update scratch-blocks to version 0.1.0-prerelease.1559136797 2019-05-29 13:35:43 +00:00
Paul Kaplan ef4d8c6e8d Merge pull request #4852 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1558719162
Update scratch-blocks to the latest version 🚀
2019-05-29 08:34:07 -04:00
Paul Kaplan a6245b87f6 Merge pull request #4866 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190528231524
chore(package): update scratch-render to version 0.1.0-prerelease.201…
2019-05-29 08:33:43 -04:00
Evelyn Eastmond fa4541e85c Adding dynamic removal of dynamically loaded scripts. 2019-05-29 08:27:20 -04:00
Evelyn Eastmond 376f5626a4 Remove auto-play on expansion. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond e17dc90983 Fix Wistia access to use window. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond a63385343a Remove useless props constructor. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond 3c3206d8e2 Remove bindAll import. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond f6c8feae6e Video play/pause test on video step expand/shrink. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond 98a007a17e Pause video on component update if not expanded. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond 3e0d5b9ede Clean up and get handle on video on load. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond 555082bb1d Change Wistia embed so video API is accessible from current window. 2019-05-28 20:34:14 -04:00
Evelyn Eastmond 5c95c352c3 Trying VideoStep component. 2019-05-28 20:34:14 -04:00
greenkeeper[bot] 3b4758ca5c chore(package): update scratch-render to version 0.1.0-prerelease.20190528231524
Closes #4864
2019-05-28 23:16:58 +00:00
Christopher Willis-Ford 38455a7108 enable monitors for dynamic extension blocks 2019-05-28 11:45:57 -07:00
Karishma Chadha ebe310bc65 Add support for arguments on dynamic extension blocks. 2019-05-28 11:45:57 -07:00
Christopher Willis-Ford 5bc3198263 remove unused require 2019-05-28 11:45:57 -07:00
Christopher Willis-Ford 5d6669db6d add "scratch_extension" only if a block has an icon 2019-05-28 11:45:57 -07:00
Christopher Willis-Ford 519ffe3b91 weave extension categories into the output of makeToolboxXML 2019-05-28 11:45:57 -07:00
Christopher Willis-Ford 717c773800 add block type check in defineDynamicBlock 2019-05-28 11:45:57 -07:00
Christopher Willis-Ford 935a4520da WIP dynamic block support 2019-05-28 11:45:56 -07:00
Christopher Willis-Ford 7685dad40a update extension event handling for categoryInfo 2019-05-28 11:45:56 -07:00
Chris Willis-Ford 699671bde5 Merge pull request #4841 from cwillisf/test-failure-feedback
add timeouts & messages to all driver.wait calls
2019-05-28 09:43:39 -07:00
Paul Kaplan 7facbf35b2 Merge pull request #4851 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190524133325
Update scratch-paint to the latest version 🚀
2019-05-24 13:38:31 -04:00
greenkeeper[bot] b54fe54b4a chore(package): update scratch-blocks to version 0.1.0-prerelease.1558719162 2019-05-24 17:35:05 +00:00
Christopher Willis-Ford 796339dcfe simplify SeleniumHelper timeout options 2019-05-24 09:35:44 -07:00
greenkeeper[bot] 1721a322c2 chore(package): update scratch-vm to version 0.2.0-prerelease.20190524155459
Closes #4840
2019-05-24 15:57:43 +00:00
greenkeeper[bot] 3125097b83 chore(package): update scratch-paint to version 0.2.0-prerelease.20190524133325 2019-05-24 13:34:51 +00:00
Paul Kaplan aa0c40fca1 Merge pull request #4850 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190524125950
Update scratch-render to the latest version 🚀
2019-05-24 09:26:53 -04:00
Paul Kaplan 2d61027bbe Merge pull request #4848 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190523193400
Update scratch-svg-renderer to the latest version 🚀
2019-05-24 09:26:33 -04:00
greenkeeper[bot] 2dac3cae81 chore(package): update scratch-render to version 0.1.0-prerelease.20190524125950 2019-05-24 13:02:23 +00:00
greenkeeper[bot] 43d3df2ffd chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190523193400 2019-05-23 19:38:15 +00:00
Paul Kaplan 44ffaeee2c Merge pull request #4847 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190523183140
Update scratch-paint to the latest version 🚀
2019-05-23 15:33:33 -04:00
greenkeeper[bot] 0bf4e2c781 chore(package): update scratch-paint to version 0.2.0-prerelease.20190523183140 2019-05-23 18:56:29 +00:00
Paul Kaplan d342b82219 Merge pull request #4800 from mzgoddard/delay-gui
Delay loading and rendering gui
2019-05-23 14:14:37 -04:00
Paul Kaplan 227581ebcf Merge pull request #4677 from mzgoddard/update-toolbox
render only new toolbox xmls
2019-05-23 14:14:09 -04:00
Paul Kaplan eb74d6c033 Include a unit test to ensure default project assets are included 2019-05-23 11:22:36 -04:00
Paul Kaplan a2035a68e4 Update the built-in SVG assets for the default project 2019-05-23 09:59:41 -04:00
Christopher Willis-Ford 1b055af545 add timeouts & messages to all driver.wait calls 2019-05-22 18:25:45 -07:00
Karishma Chadha 5b79947178 Merge pull request #4842 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190522213620
Update scratch-paint to the latest version 🚀
2019-05-22 17:40:57 -04:00
Karishma Chadha 9e329b999e Merge branch 'develop' into greenkeeper/scratch-paint-0.2.0-prerelease.20190522213620 2019-05-22 17:40:44 -04:00
Karishma Chadha e5e0c3dd28 Merge pull request #4843 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190522213558
Update scratch-render to the latest version 🚀
2019-05-22 17:39:51 -04:00
greenkeeper[bot] e810422429 chore(package): update scratch-render to version 0.1.0-prerelease.20190522213558 2019-05-22 21:38:44 +00:00
greenkeeper[bot] 8b2c590309 chore(package): update scratch-paint to version 0.2.0-prerelease.20190522213620 2019-05-22 21:38:30 +00:00
Benjamin Wheeler d92ef0c807 Merge pull request #4833 from LLK/greenkeeper/scratch-storage-1.3.2
Update scratch-storage to the latest version 🚀
2019-05-22 14:42:44 -04:00
Benjamin Wheeler faa14b7add Merge branch 'develop' into greenkeeper/scratch-storage-1.3.2 2019-05-22 14:42:11 -04:00
Benjamin Wheeler abbc8ddad0 Merge pull request #4837 from LLK/greenkeeper/scratch-l10n-3.3.20190522144128
Update scratch-l10n to the latest version 🚀
2019-05-22 14:41:02 -04:00
Benjamin Wheeler 551e03b256 Merge pull request #4822 from LLK/greenkeeper/react-intl-2.9.0
Update react-intl to the latest version 🚀
2019-05-22 14:30:36 -04:00
Paul Kaplan f65f80160f Merge pull request #4834 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190521170426
Update scratch-svg-renderer to the latest version 🚀
2019-05-22 14:05:17 -04:00
Paul Kaplan 5438c14bdb Merge branch 'develop' into greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190521170426 2019-05-22 14:04:51 -04:00
Paul Kaplan 8f3d84ec60 Merge pull request #4830 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190520172914
Update scratch-vm to the latest version 🚀
2019-05-22 13:55:03 -04:00
greenkeeper[bot] c3df930bea chore(package): update scratch-l10n to version 3.3.20190522144128 2019-05-22 14:43:31 +00:00
greenkeeper[bot] 4513a45306 chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190521170426 2019-05-21 17:06:21 +00:00
greenkeeper[bot] a94a83dc4f chore(package): update scratch-storage to version 1.3.2 2019-05-21 16:06:05 +00:00
Eric Rosenbaum e1e5c8352c Merge pull request #4806 from ericrosenbaum/bugfix/no-surprise-letters
Surprise sprite button does not give you letters
2019-05-21 11:55:00 -04:00
Paul Kaplan 98ceb00bb4 Fix lint 2019-05-21 11:01:48 -04:00
Paul Kaplan 77974839b0 Make surprise and library backdrop additions NOT select the stage 2019-05-21 10:46:05 -04:00
greenkeeper[bot] 706341011a chore(package): update scratch-vm to version 0.2.0-prerelease.20190520172914 2019-05-20 17:32:00 +00:00
Christopher Willis-Ford a83d9369dc Revert "Merge pull request #4735 from paulkaplan/revert-storage-update"
Go back to `scratch-storage` version 1.3.1 in the `scratch-desktop`
branch so that we have the performance improvements from
LLK/scratch-storage#83

If I understand correctly we reverted from 1.3.1 to 1.2.2 because of
problems affecting HTTP saves, which are not available in Scratch
Desktop.

This reverts commit b435ac3101, reversing
changes made to 0d7a05d37a.
2019-05-16 19:59:58 -07:00
Christopher Willis-Ford 012bb612ad Revert "Merge pull request #4736 from LLK/revert-4644-load-library-images-through-storage"
This brings "Load library images through storage" back into the
`scratch-desktop` branch since it's necessary here. We need to figure
out some performance details before trying to merge it into `develop`
though.
2019-05-16 19:50:38 -07:00
Christopher Willis-Ford b9e7bde676 Merge tag '0.1.0-prerelease.20190516172446' into scratch-desktop 2019-05-16 12:38:02 -07:00
chrisgarrity 4a26810956 Merge pull request #4825 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190516171147
Update scratch-paint to the latest version 🚀
2019-05-16 13:14:51 -04:00
greenkeeper[bot] 92fd318aa8 chore(package): update scratch-paint to version 0.2.0-prerelease.20190516171147 2019-05-16 17:13:17 +00:00
chrisgarrity bc2555ddc4 Merge pull request #4824 from LLK/greenkeeper/scratch-l10n-3.3.20190516144548
Update scratch-l10n to the latest version 🚀
2019-05-16 10:56:28 -04:00
greenkeeper[bot] 8ee9794304 chore(package): update scratch-l10n to version 3.3.20190516144548 2019-05-16 14:48:58 +00:00
picklesrus 30388ffa4f Merge pull request #4819 from LLK/greenkeeper/scratch-l10n-3.3.20190515143901
Update scratch-l10n to the latest version 🚀
2019-05-15 15:33:14 -04:00
greenkeeper[bot] fdea0a1620 chore(package): update react-intl to version 2.9.0 2019-05-15 18:01:27 +00:00
picklesrus 41e2909782 Merge pull request #4821 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190515153227
chore(package): update scratch-vm to version 0.2.0-prerelease.2019051…
2019-05-15 13:16:09 -04:00
greenkeeper[bot] 4048ed8c84 chore(package): update scratch-vm to version 0.2.0-prerelease.20190515153227
Closes #4804
2019-05-15 15:36:48 +00:00
greenkeeper[bot] 7a21b17d0c chore(package): update scratch-l10n to version 3.3.20190515143901 2019-05-15 14:41:54 +00:00
chrisgarrity 72bc6f3005 Merge pull request #4816 from chrisgarrity/add-rap-uz
Update dependencies for Rapa Nui and Uzbek
2019-05-15 08:05:33 -04:00
Chris Garrity a8a7e0c92f Update dependencies for Rapa Nui 2019-05-14 18:18:43 -04:00
Eric Rosenbaum a11fcfe373 Fix typo in variable name 2019-05-09 15:12:13 -04:00
Eric Rosenbaum 52a3600819 Surprise sprites do not include letters and numbers 2019-05-09 15:06:26 -04:00
Michael "Z" Goddard bec6223e6e delay loading and rendering gui
- Create the scratch renderer earlier in the GUI container/HOC stack
- Delay loading and rendering GUI component until after project assets
  have been fetched
2019-05-08 16:58:07 -04:00
Paul Kaplan 333b91ccfd Merge pull request #4802 from LLK/greenkeeper/scratch-l10n-3.2.20190508143856
Update scratch-l10n to the latest version 🚀
2019-05-08 14:27:43 -04:00
greenkeeper[bot] a3266fe641 chore(package): update scratch-l10n to version 3.2.20190508143856 2019-05-08 14:53:25 +00:00
Evelyn Eastmond 10449a21b5 Merge pull request #4801 from evhan55/bugfix/4799
Enable pointer events for workspace while tutorial is showing
2019-05-08 08:38:20 -04:00
Evelyn Eastmond 29f5d2a872 Fixing pointer events to not prevent clicks in workspace. 2019-05-07 15:43:35 -04:00
Evelyn Eastmond f8b3e4961c Merge pull request #4731 from evhan55/feature/4670
Add shrink/expand and new fencing feature to tutorial cards
2019-05-07 12:53:02 -04:00
Evelyn Eastmond cca701e954 Add more layout for RTL. 2019-05-07 11:52:27 -04:00
Evelyn Eastmond 89c0807cba Reset position and expanded state of cards on activation. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 544a4c745d Change drag offset var names. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond f6e9a7dd23 Remove console log from reducer, fix variable and comments in component. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 69132b6f43 Add variables for calculation of custom dragging bounds. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond aa88e2c6a6 Removing tester top/left positions. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond b89734b0e9 Add preliminary fencing div/overlay, with Paul's help. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond d5eb058d00 Fixing linting and an extra line. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond fe308b6b58 Commenting out div overlay hack for now. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond ab14942c80 Starting to play with Draggable for cards. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 908cb2e5c6 New close button and some margin for text. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 6935aa0820 Add formattedmessage to shrink/expand labels. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 4ec8ac16a8 Reword 'toggle' to 'shrinkExpand' throughout code. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond bfe2877d0b Rename icon, add shrink expand icons to card header. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 9d50e9a165 Adding initial shrink/expand icons. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond eb496cfe75 Give cards a min-width so shrink/expand doesn't change size. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond dfd01da913 Using a hidden css style, cleaning up left/right button and card hiding. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond c8bdb6ce09 Change remove and toggle buttons flow to column for stacking layout. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 3169c03e66 Reverse order of close button icon and label. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 26323cccf2 Hide bottom border on header in shrink mode. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 2bb9a61539 Fixing right-card and card-preview to use toggle correctly. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 4efd3fcbad Rename shrinkButton to toggleButton. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 170705440a Adding toggle state to Cards. Using toggle state to set the CSS state. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond a52fdaa032 Completing propagation of toddleCards. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 6d972da227 Adding a stub toggleCards reducer. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond 96bd677ef9 Starting to add an onToggleCards prop. 2019-05-07 11:42:40 -04:00
Evelyn Eastmond b77bc7a8b4 Adding a new div to hold the shrink button. 2019-05-07 11:42:40 -04:00
Paul Kaplan 7f06f55f83 Merge pull request #4798 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190506184649
Update scratch-vm to the latest version 🚀
2019-05-07 08:41:22 -04:00
greenkeeper[bot] 04381439c2 chore(package): update scratch-vm to version 0.2.0-prerelease.20190506184649 2019-05-06 18:49:45 +00:00
Paul Kaplan 7b658c60c7 Merge pull request #4786 from paulkaplan/update-eslint-react
Update eslint-plugin-react and fix newly discovered lint errors.
2019-05-06 10:33:59 -04:00
picklesrus 0c68103eb6 Merge pull request #4664 from mzgoddard/is-3d-supported
replace Blocks.utils.is3dSupported with constant value function
2019-05-02 11:53:52 -04:00
Michael "Z" Goddard 65c787d0da replace Blocks.utils.is3dSupported with constant value function 2019-05-01 17:31:39 -04:00
chrisgarrity 0b40daf936 Merge pull request #4793 from LLK/greenkeeper/scratch-l10n-3.2.20190501144004
chore(package): update scratch-l10n to version 3.2.20190501144004
2019-05-01 17:09:25 -04:00
chrisgarrity 75607ebbe3 Merge pull request #4792 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190430163103
chore(package): update scratch-vm to version 0.2.0-prerelease.2019043…
2019-05-01 17:07:50 -04:00
Paul Kaplan 58b178f679 Merge pull request #4775 from LLK/greenkeeper/chromedriver-74.0.0
chore(package): update chromedriver to version 74.0.0
2019-05-01 15:00:07 -04:00
Paul Kaplan ffeebb03bd Update eslint-plugin-react and fix new lint errors.
This includes a small bug where the target pane wouldn't automatically update if changes to the sprite occured while in fullscreen/player mode.

Closes #4221
2019-05-01 11:01:44 -04:00
greenkeeper[bot] 7c1f0d2739 chore(package): update scratch-l10n to version 3.2.20190501144004
Closes #4774
2019-05-01 14:42:15 +00:00
Eric Rosenbaum ac0c6a4305 Merge pull request #4785 from ericrosenbaum/feature/enable-boost
Enable the boost extension
2019-05-01 10:22:09 -04:00
Benjamin Wheeler ff776dc90c Merge pull request #4784 from benjiwheeler/fix-save-on-see-project-page
Fix auto-save when clicking See Project Page
2019-05-01 09:44:24 -04:00
Ben Wheeler 516baedad9 added tests, rewrote menu-bar-hoc to accomodate tests 2019-05-01 07:02:07 -04:00
Michael "Z" Goddard d83ec5a0b5 replace blocks timeout with a promise
The timeout as a promise lets us update the toolbox during the same
render as the workspace so that the screen updates all together. This
also means the toolbox will update before the loading screen is
dismissed after loading, letting us avoid a second flash for the
toolbox to update.
2019-04-30 16:36:52 -04:00
Eric Rosenbaum 1c8ba1d1eb enable boost extension 2019-04-30 16:13:50 -04:00
Ben Wheeler 16024769c8 renamed confirm-replace-hoc to menu-bar-hoc; moved project changed checking there 2019-04-30 15:02:22 -04:00
Paul Kaplan ed9316266e Merge pull request #4782 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190430175441
Update scratch-paint to the latest version 🚀
2019-04-30 14:35:22 -04:00
greenkeeper[bot] 103f55bd6e chore(package): update scratch-paint to version 0.2.0-prerelease.20190430175441 2019-04-30 17:56:07 +00:00
greenkeeper[bot] 009d9db74f chore(package): update scratch-vm to version 0.2.0-prerelease.20190430163103
Closes #4781
2019-04-30 16:33:45 +00:00
Paul Kaplan 416bc85455 Merge pull request #4717 from gunchleoc/add-troubleshooting-documentation
Add troubleshooting documentation
2019-04-29 13:15:59 -04:00
Benjamin Wheeler 88a5ab8052 Cleaned up wording and explanation around npm linking 2019-04-28 12:44:39 -04:00
Paul Kaplan 31454f7ca0 Seriously, update VM to a version that actually exists 2019-04-24 17:15:09 -04:00
Eric Rosenbaum bfd0712c83 update scratch-vm 2019-04-24 16:43:00 -04:00
Eric Rosenbaum 3c9d482a02 Merge pull request #4773 from LLK/ericrosenbaum-update-vm
Update scratch-vm
2019-04-24 13:25:02 -04:00
Eric Rosenbaum 5c3694ec19 Update scratch-vm 2019-04-24 13:24:48 -04:00
Eric Rosenbaum 997abfeb27 Merge pull request #4772 from LLK/greenkeeper/scratch-l10n-3.2.20190424151256
chore(package): update scratch-l10n to version 3.2.20190424151256
2019-04-24 12:56:25 -04:00
Eric Rosenbaum df77245f0d Merge branch 'develop' into greenkeeper/scratch-l10n-3.2.20190424151256 2019-04-24 12:55:55 -04:00
Eric Rosenbaum 5e2ea2ee64 Merge pull request #4771 from LLK/ericrosenbaum-update-blocks
update scratch-blocks version
2019-04-24 12:51:59 -04:00
Eric Rosenbaum 655af4ed31 update scratch-blocks version 2019-04-24 12:51:33 -04:00
chrisgarrity 9d385faa84 Merge pull request #4769 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1556058260
Update scratch-blocks to the latest version 🚀
2019-04-24 11:18:42 -04:00
greenkeeper[bot] 455808fe26 chore(package): update scratch-l10n to version 3.2.20190424151256
Closes #4770
2019-04-24 15:14:51 +00:00
greenkeeper[bot] c2dbdc6279 chore(package): update chromedriver to version 74.0.0
Closes #4077
2019-04-24 13:33:48 +00:00
greenkeeper[bot] 8faf8af5da chore(package): update scratch-blocks to version 0.1.0-prerelease.1556058260 2019-04-24 11:08:41 +00:00
Eric Rosenbaum cfaf1ee049 Merge pull request #4756 from ericrosenbaum/bugfix/go-space-direct
Fix Vernier branding (“Go Direct”)
2019-04-23 17:54:09 -04:00
Eric Rosenbaum 29d9bb0d41 Merge branch 'develop' into bugfix/go-space-direct 2019-04-23 17:25:06 -04:00
Paul Kaplan 9d185bd6c8 Merge pull request #4753 from paulkaplan/project-save-trigger
Allow GUI consumer to receive a function for triggering saves.
2019-04-23 08:32:36 -04:00
Paul Kaplan 7c26245c53 Merge pull request #4757 from paulkaplan/remove-feedback-button
Remove unneeded feedback button in menubar
2019-04-23 08:32:09 -04:00
Paul Kaplan 4dc3f73e74 Merge pull request #4763 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190419202157
Update scratch-render to the latest version 🚀
2019-04-23 08:31:52 -04:00
greenkeeper[bot] 1a66060aa2 chore(package): update scratch-render to version 0.1.0-prerelease.20190419202157 2019-04-20 22:39:55 +00:00
Benjamin Wheeler cf9e165ccf Merge pull request #4676 from mzgoddard/menu-bar
Move projectChanged into HOC wrapping MenuBar, to avoid unnecessary renders
2019-04-19 17:29:10 -04:00
Eric Rosenbaum e877486daa Merge pull request #4761 from ericrosenbaum/feature/boost-assets
Add Boost extension assets
2019-04-19 17:24:55 -04:00
Paul Kaplan 1eb095e235 Merge pull request #4760 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190419183947
Update scratch-svg-renderer to the latest version 🚀
2019-04-19 15:17:43 -04:00
Eric Rosenbaum 905e938c57 Move the boost tile into the correct order 2019-04-19 14:55:11 -04:00
Eric Rosenbaum fe8b914f8d Add Boost extension assets 2019-04-19 14:45:54 -04:00
greenkeeper[bot] a48cc065c0 chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190419183947 2019-04-19 18:45:35 +00:00
Paul Kaplan 6e50909e0f Remove feedback icon 2019-04-19 13:17:48 -04:00
Paul Kaplan 6480b262de Remove unused import 2019-04-19 13:17:26 -04:00
Paul Kaplan a0745e4f40 Allow GUI consumer to receive a function for triggering saves.
Use the same implementation as onSetProjectThumbnailer which does the same thing for getting a thumbnail externally.
2019-04-19 09:19:00 -04:00
Paul Kaplan 8eb9e37d67 Remove unneeded feedback button in menubar
It is no longer needed, as the playground is no longer the public face of scratch gui
2019-04-18 13:49:28 -04:00
Eric Rosenbaum 69506d9c1d Fix Vernier branding (“Go Direct”) 2019-04-18 11:59:33 -04:00
Benjamin Wheeler d37f1fcae1 Merge pull request #4755 from benjiwheeler/fix-upload-confirm
removed confirm prompt if you are editing someone else's project and then do file -> upload
2019-04-18 11:48:53 -04:00
Ben Wheeler dfb7b55145 removed confirm prompt if you are editing someone else's project and then do file -> upload 2019-04-18 11:34:11 -04:00
Karishma Chadha 6e335085d1 Merge pull request #4750 from LLK/greenkeeper/scratch-l10n-3.2.20190417195644
chore(package): update scratch-l10n to version 3.2.20190417195644
2019-04-17 17:51:40 -04:00
Karishma Chadha cde9660b12 Merge pull request #4751 from LLK/greenkeeper/react-intl-2.8.0
chore(package): update react-intl to version 2.8.0
2019-04-17 17:30:19 -04:00
Karishma Chadha abe782cdba Merge pull request #4752 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190417203423
chore(package): update scratch-vm to version 0.2.0-prerelease.2019041…
2019-04-17 17:08:23 -04:00
greenkeeper[bot] 96f3377733 chore(package): update scratch-vm to version 0.2.0-prerelease.20190417203423
Closes #4740
2019-04-17 20:37:00 +00:00
Karishma Chadha e43011233f Merge branch 'develop' into greenkeeper/scratch-l10n-3.2.20190417195644 2019-04-17 16:24:13 -04:00
Karishma Chadha 7c4d92ac08 Merge pull request #4743 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190416185326
Update scratch-paint to the latest version 🚀
2019-04-17 16:21:46 -04:00
Karishma Chadha 3033717d67 Merge pull request #4748 from LLK/hotfix/assetIdNull
Hotfix/asset id null
2019-04-17 16:17:40 -04:00
greenkeeper[bot] 5a2bec60d9 chore(package): update scratch-l10n to version 3.2.20190417195644
Closes #4746
2019-04-17 19:58:37 +00:00
chrisgarrity 7e2f9b8361 Merge pull request #4747 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1555512815
Update scratch-blocks to the latest version 🚀
2019-04-17 15:47:56 -04:00
Benjamin Wheeler 5c1d3e38bd Merge pull request #4710 from benjiwheeler/only-autosave-if-changed
Share, See-project-page buttons will only save if project has changed
2019-04-17 14:55:22 -04:00
Benjamin Wheeler f8243eae9e Merge pull request #4700 from benjiwheeler/upload-in-place
upload in current project id, rather than creating new project id
2019-04-17 14:54:51 -04:00
greenkeeper[bot] 14ead16a8a chore(package): update scratch-blocks to version 0.1.0-prerelease.1555512815 2019-04-17 14:58:11 +00:00
Ben Wheeler c064eaed4e upload in current project id, rather than creating new project id 2019-04-16 23:34:07 -04:00
Karishma Chadha 5758626777 Fix travis.yml before_deploy script to correctly pattern match 2019-04-16 16:01:40 -04:00
greenkeeper[bot] 934396d87a chore(package): update scratch-paint to version 0.2.0-prerelease.20190416185326 2019-04-16 18:55:08 +00:00
Karishma Chadha 130c5de4b0 Update travis yml so that hotfix/ branches are released to hotfix channel 2019-04-16 14:33:12 -04:00
Karishma Chadha 09bcfba800 Add hotfix prefix as branch for releasing 2019-04-16 11:06:47 -04:00
Karishma Chadha cb928b8490 Merge pull request #4733 from paulkaplan/presave-backpack-asset
Make sure to save assets before sending them to the backpack
2019-04-16 11:05:03 -04:00
Evelyn Eastmond 4aba90c8fb Merge pull request #4724 from evhan55/bugfix/4668
Changing tutorial video width to be smaller
2019-04-12 14:35:03 -04:00
Karishma Chadha 308568a332 Fix bugs found while testing related to retrieving and storing asset. 2019-04-12 12:10:49 -04:00
Paul Kaplan c87560aabc Merge pull request #4734 from LLK/revert-4732-greenkeeper/scratch-render-0.1.0-prerelease.20190410184112
Revert "Update scratch-render to the latest version 🚀"
2019-04-11 11:15:29 -04:00
Paul Kaplan 13f72153a3 Merge branch 'develop' into revert-4732-greenkeeper/scratch-render-0.1.0-prerelease.20190410184112 2019-04-11 11:15:17 -04:00
Paul Kaplan b435ac3101 Merge pull request #4735 from paulkaplan/revert-storage-update
Revert storage update due to asset saving errors
2019-04-11 11:14:36 -04:00
Paul Kaplan 0d7a05d37a Merge pull request #4736 from LLK/revert-4644-load-library-images-through-storage
Revert "Load library images through storage"
2019-04-11 11:14:20 -04:00
Paul Kaplan 0fbbf55b51 Revert "Load library images through storage" 2019-04-11 11:13:34 -04:00
Paul Kaplan a9c624b746 Revert storage update due to asset saving errors 2019-04-11 11:12:38 -04:00
Paul Kaplan 0caee112e0 Revert "Update scratch-render to the latest version 🚀" 2019-04-11 11:09:22 -04:00
Paul Kaplan 17e28b2a24 Make sure to save assets before sending them to the backpack
This prevents assets from existing in the backpack server without also existing in the asset server.
2019-04-11 08:29:46 -04:00
Paul Kaplan 7fcbae60bc Merge pull request #4732 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190410184112
Update scratch-render to the latest version 🚀
2019-04-10 16:39:15 -04:00
greenkeeper[bot] 9aabea4065 chore(package): update scratch-render to version 0.1.0-prerelease.20190410184112 2019-04-10 18:52:08 +00:00
Chris Willis-Ford 8a1b104f28 Merge pull request #4644 from cwillisf/load-library-images-through-storage
Load library images through storage
2019-04-10 11:35:46 -07:00
Paul Kaplan 8f35eacf9f Merge pull request #4726 from LLK/greenkeeper/scratch-storage-1.3.1
chore(package): update scratch-storage to version 1.3.1
2019-04-10 13:29:57 -04:00
GunChleoc 327983fc8c Shift new troubleshooting documentation to README.md 2019-04-10 17:47:52 +01:00
Paul Kaplan 57ede34c29 Merge pull request #4730 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190410143927
chore(package): update scratch-vm to version 0.2.0-prerelease.2019041…
2019-04-10 12:12:27 -04:00
Paul Kaplan d76eacd7e5 Merge pull request #4728 from LLK/greenkeeper/scratch-l10n-3.1.20190410143750
Update scratch-l10n to the latest version 🚀
2019-04-10 12:11:58 -04:00
greenkeeper[bot] 32f9ae614c chore(package): update scratch-vm to version 0.2.0-prerelease.20190410143927
Closes #4727
2019-04-10 14:42:12 +00:00
greenkeeper[bot] 490c56e46e chore(package): update scratch-l10n to version 3.1.20190410143750 2019-04-10 14:40:08 +00:00
Paul Kaplan c5290a2640 Use an actual url for backpack host so storage doesnt explode 2019-04-10 09:19:13 -04:00
Paul Kaplan 00f07c3801 Merge pull request #4690 from ericrosenbaum/bugfix/load-ext-without-library-assets
Prevent crash on load hardware ext without assets
2019-04-10 09:06:53 -04:00
Paul Kaplan a441cbbe60 Merge pull request #4725 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190409205534
chore(package): update scratch-vm to version 0.2.0-prerelease.2019040…
2019-04-10 09:01:42 -04:00
greenkeeper[bot] 8656148a91 chore(package): update scratch-vm to version 0.2.0-prerelease.20190409205534
Closes #4714
2019-04-09 20:58:10 +00:00
Eric Rosenbaum b32e0ca6d7 Merge pull request #4720 from ericrosenbaum/feature/add-vernier-extension2
Add Vernier Force and Accel extension
2019-04-09 15:32:11 -04:00
Evelyn Eastmond 5b4daec4ab Fixing video height in iframe so the video controls show better. 2019-04-09 13:57:25 -04:00
Evelyn Eastmond aed66d49cf Changing tutorial video width to be smaller and match other tutorial steps. Cutting off video by about 5 pixels on the bottom to prevent any jittering between steps. 2019-04-09 13:53:45 -04:00
Eric Rosenbaum 5d5331b0ad Optimized image assets 2019-04-08 15:48:55 -04:00
Eric Rosenbaum 83b48a683a Add Vernier extension tile 2019-04-08 14:16:10 -04:00
GunChleoc 93477a19d6 Add page title to troubleshooting documentation 2019-04-07 08:27:58 +01:00
GunChleoc a87b08d791 Add troubleshooting page 2019-04-07 08:26:02 +01:00
chrisgarrity 494269bcf5 Merge pull request #4716 from LLK/greenkeeper/scratch-l10n-3.1.20190404094457
Update scratch-l10n to the latest version 🚀
2019-04-04 12:02:42 +02:00
greenkeeper[bot] c684774f06 chore(package): update scratch-l10n to version 3.1.20190404094457 2019-04-04 09:47:04 +00:00
greenkeeper[bot] 9296438911 chore(package): update scratch-storage to version 1.3.1
Closes #4697
2019-04-03 19:29:15 +00:00
Paul Kaplan e9a9767f67 Merge pull request #4689 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190326161919
Update scratch-render to the latest version 🚀
2019-04-03 13:55:35 -04:00
Paul Kaplan 174bd295e1 Merge pull request #4713 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1554297463
chore(package): update scratch-blocks to version 0.1.0-prerelease.155…
2019-04-03 13:55:13 -04:00
Paul Kaplan 57a9e0b8ca Merge pull request #4698 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190329052730
Update scratch-svg-renderer to the latest version 🚀
2019-04-03 13:54:04 -04:00
Paul Kaplan e89a8eab11 Merge branch 'develop' into greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20190329052730 2019-04-03 13:53:51 -04:00
Paul Kaplan 98274c8b8e Merge pull request #4699 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190329172358
Update scratch-vm to the latest version 🚀
2019-04-03 13:53:23 -04:00
Karishma Chadha c8617289bc Merge pull request #4712 from kchadha/extension-button-support
Register callback keys for buttons used in future extensions.
2019-04-03 11:39:08 -04:00
Karishma Chadha e82e370e83 Register callback keys for buttons used in future extensions. 2019-04-03 11:10:10 -04:00
greenkeeper[bot] e2adf9bf14 chore(package): update scratch-blocks to version 0.1.0-prerelease.1554297463
Closes #4692
2019-04-03 13:20:07 +00:00
Ben Wheeler 881e17dc67 See project page button will only save if user can save AND project has changed 2019-04-01 14:40:48 -04:00
Benjamin Wheeler 021063470d Merge pull request #4709 from benjiwheeler/projects-editor-pushstate
Keep URI correct when uploading project while signed out
2019-04-01 14:23:33 -04:00
Ben Wheeler 2b5196106a remove code in sb-file-uploader that sets uri history on loading project from file 2019-04-01 14:08:11 -04:00
greenkeeper[bot] 628bc2cd26 chore(package): update scratch-vm to version 0.2.0-prerelease.20190329172358 2019-03-30 01:07:25 +00:00
greenkeeper[bot] 6d5a6d407b chore(package): update scratch-svg-renderer to version 0.2.0-prerelease.20190329052730 2019-03-30 00:10:29 +00:00
chrisgarrity ce6df3633a Merge pull request #4695 from chrisgarrity/update-l10n
update scratch-l10n to latest
2019-03-29 10:19:05 +01:00
chrisgarrity fecc6f4f6f update scratch-l10n to latest 2019-03-29 09:37:48 +01:00
Paul Kaplan 839deda612 Merge pull request #4674 from mzgoddard/project-changed
dispatch projectChange redux action when project has not changed
2019-03-28 14:01:18 -04:00
Paul Kaplan dac1ece8fd Merge pull request #4665 from mzgoddard/locale-string
use Collator.compare in place of localeCompare
2019-03-28 13:51:42 -04:00
Michael "Z" Goddard fc8c242173 separate projectChanged, MenuBar doesn't need it to render
Rendering the MenuBar does not depend on projectChanged. Some of its
event handling does. Abstracting that dependency we can handle some
behaviour in MenuBar without extra renders.
2019-03-27 11:12:30 -04:00
Michael "Z" Goddard 866af2f766 render toolboxes once the workspace has rendered 2019-03-26 17:33:42 -04:00
Eric Rosenbaum 4fab686aea Prevent crash on load hardware ext without assets 2019-03-26 15:59:03 -04:00
greenkeeper[bot] bfae437886 chore(package): update scratch-render to version 0.1.0-prerelease.20190326161919 2019-03-26 17:25:12 +00:00
Ray Schamp c9a989bfab Merge pull request #4688 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190325203133
chore(package): update scratch-vm to latest version
2019-03-26 12:07:05 -04:00
Ray Schamp 9bd2ca246b Update package.json 2019-03-26 12:06:24 -04:00
Ray Schamp f2b9732748 Merge pull request #4687 from rschamp/no-publish-greenkeeper
Exclude greenkeeper builds from gh-pages
2019-03-26 10:41:23 -04:00
Ray fda637edba Exclude greenkeeper builds from gh-pages
They take up so much space and time, but aren't really looked at very much
2019-03-26 10:38:07 -04:00
Ray Schamp a8ea46a357 Merge pull request #4682 from ericrosenbaum/bugfix/webpack-for-vernier-only
Add vernier module to webpack config
2019-03-26 09:44:56 -04:00
Eric Rosenbaum 37826cb901 add vernier module to webpack config 2019-03-25 17:18:37 -04:00
greenkeeper[bot] 6fec13c941 chore(package): update scratch-vm to version 0.2.0-prerelease.20190325203133
Closes #4678
2019-03-25 20:34:08 +00:00
Michael "Z" Goddard 656e8c2c77 render only new toolbox xmls 2019-03-21 14:57:22 -04:00
picklesrus f86fd4995f Merge pull request #4675 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190321151527
Update scratch-vm to the latest version 🚀
2019-03-21 11:21:53 -04:00
greenkeeper[bot] 596bdad97a chore(package): update scratch-vm to version 0.2.0-prerelease.20190321151527 2019-03-21 15:18:06 +00:00
Paul Kaplan 2522ad378a Merge pull request #4661 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190318170811
Update scratch-paint to the latest version 🚀
2019-03-20 15:27:00 -04:00
Paul Kaplan 09d9b51c20 Merge pull request #4673 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190320150859
Update scratch-vm to the latest version 🚀
2019-03-20 15:06:35 -04:00
Michael "Z" Goddard 3f73c6df7b dispatch projectChange redux action when project has not changed
Dispatching a message through redux makes it reconsider all currently
listening components. Dispatching for each block, while loading, can
mean dispatching and reconsidering thousands of times if not more.
While dispatching is pretty quick doing this for every block ends up
taking a lot of time.
2019-03-20 14:37:02 -04:00
greenkeeper[bot] fb85d6ab51 chore(package): update scratch-vm to version 0.2.0-prerelease.20190320150859 2019-03-20 17:12:24 +00:00
Paul Kaplan 97b056ea87 Merge pull request #4671 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190319213349
Update scratch-vm to the latest version 🚀
2019-03-20 11:51:53 -04:00
greenkeeper[bot] 05027a5aee chore(package): update scratch-vm to version 0.2.0-prerelease.20190319213349 2019-03-19 23:42:48 +00:00
Michael "Z" Goddard f5d1dd7e03 use Collator.compare in place of localeCompare 2019-03-19 17:14:05 -04:00
Karishma Chadha e0f8497b48 Merge pull request #4666 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190319154833
chore(package): update scratch-vm to version 0.2.0-prerelease.2019031…
2019-03-19 14:08:09 -04:00
greenkeeper[bot] 0abb94bc81 chore(package): update scratch-vm to version 0.2.0-prerelease.20190319154833
Closes #4662
2019-03-19 15:59:11 +00:00
Evelyn Eastmond 66b3f43581 Merge pull request #4657 from evhan55/extensions/lib-index-file-refactor
Refactor extensions library index file
2019-03-19 11:10:58 -04:00
Paul Kaplan e0db28d82b Merge pull request #4659 from paulkaplan/external-project-save
Move project saving to server to helper, allow external save action
2019-03-18 16:49:29 -04:00
greenkeeper[bot] cf86e4c432 chore(package): update scratch-paint to version 0.2.0-prerelease.20190318170811 2019-03-18 19:58:40 +00:00
Christopher Willis-Ford 28cd140d9f Cancel ScratchImage load if unmounted 2019-03-18 12:58:25 -07:00
Paul Kaplan 00a4db1213 Remove complexity around promise/non-promise.
Since this is in a promise chain, it doesn't matter if onUpdateProjectData returns a promise or a primitive, it'll work either way
2019-03-18 15:09:31 -04:00
Christopher Willis-Ford 5f6b89ec2a Simplify unnecessarily complicated loop 2019-03-18 12:07:41 -07:00
Evelyn Eastmond a4cb3b1eb5 Changing React property name for connection tip icon throughout. 2019-03-18 15:04:12 -04:00
Evelyn Eastmond 8e3bd8c631 Changing prop names throughout React chain to reflect new extension library property names. 2019-03-18 14:58:32 -04:00
Evelyn Eastmond a74bb9afc7 Renaming more variable names related to connection modal properties. 2019-03-18 14:50:49 -04:00
Evelyn Eastmond a082d8329e Adding speech2text folder for extension library. 2019-03-18 14:44:43 -04:00
Evelyn Eastmond 9f9a780093 Adding TODO comments for some file renaming suggestions. 2019-03-18 14:44:43 -04:00
Evelyn Eastmond 8c36ad3cc2 Adding some comments for possible variable name changes. 2019-03-18 14:44:43 -04:00
Evelyn Eastmond 1b2555c7de Renaming some more variables in the extensions library index file. 2019-03-18 14:44:43 -04:00
Evelyn Eastmond 996ed08908 Adding asset folders, moving files, and renaming some extension library variables. 2019-03-18 14:44:43 -04:00
Paul Kaplan 7709580710 Move project saving to server to helper, allow external save action 2019-03-18 12:00:01 -04:00
Christopher Willis-Ford 992f012ff3 TO REVERT: Scratch Desktop GUI hacks
At some point these things will be changed / disabled / removed in
master or develop; at that point this change should be replaced with the
more official approach.
2019-03-14 11:51:38 -07:00
Christopher Willis-Ford c53b88dbad use relative publicPath for file-loader 2019-03-14 11:51:38 -07:00
Christopher Willis-Ford 1fd9a1f689 Merge branch 'develop' into load-library-images-through-storage 2019-03-14 11:49:47 -07:00
Chris Willis-Ford f773ee2dab Merge branch 'develop' into load-library-images-through-storage 2019-03-13 16:33:38 -07:00
Christopher Willis-Ford a7487fb26d Fix ScratchImage current jobs count going NaN 2019-03-13 16:00:24 -07:00
Christopher Willis-Ford ce5aa9fb7a Fix ScratchImage visibility check on Windows Firefox ESR 2019-03-13 11:09:36 -07:00
Christopher Willis-Ford 790fc13157 Fix ScratchImage incompatibilities 2019-03-12 15:01:50 -07:00
Christopher Willis-Ford face0d20d4 Test library icon rotation by comparing src over time 2019-03-12 15:01:50 -07:00
Christopher Willis-Ford 5c16407818 Fix imageSource for rotating library icons 2019-03-12 15:01:50 -07:00
Christopher Willis-Ford d8201fd4ad Merge branch 'develop' into scratch-desktop
Conflicts:
	src/components/library-item/library-item.jsx
	src/components/library/library.jsx
	src/components/menu-bar/menu-bar.jsx
	src/containers/library-item.jsx
	src/lib/project-saver-hoc.jsx
2019-03-12 15:01:42 -07:00
Christopher Willis-Ford 2b1cd4951d Merge remote-tracking branch 'upstream/develop' into scratch-desktop 2019-03-12 15:01:26 -07:00
Christopher Willis-Ford 849fe8fc0c Merge branch 'develop' into scratch-desktop 2019-03-12 15:01:25 -07:00
Christopher Willis-Ford f600e6095e Merge remote-tracking branch 'upstream/develop' into scratch-desktop 2019-03-12 15:01:25 -07:00
Christopher Willis-Ford d952f774dd Merge remote-tracking branch 'upstream/develop' into scratch-desktop 2019-03-12 15:01:25 -07:00
Christopher Willis-Ford 38ee27d896 Merge remote-tracking branch 'upstream/develop' into scratch-desktop 2019-03-12 15:01:24 -07:00
Christopher Willis-Ford 73e1bc352b Merge remote-tracking branch 'upstream/develop' into scratch-desktop 2019-03-12 15:01:24 -07:00
Christopher Willis-Ford 46ce75bf2a Prevent crash when opening tutorials library 2019-03-12 15:01:23 -07:00
Christopher Willis-Ford 2c285fee8a Load 6 ScratchImages at a time, prioritize visible 2019-03-12 15:01:08 -07:00
Christopher Willis-Ford d1c3cf8bb0 Move image-from-storage code into new ScratchImage component 2019-03-12 14:38:25 -07:00
Christopher Willis-Ford a09c7ddb53 Clarify getAssetTypeForExtension 2019-03-12 14:38:25 -07:00
Christopher Willis-Ford fec81c93a3 Make sure icon load starts immediately 2019-03-12 14:38:25 -07:00
Christopher Willis-Ford 2b3c70dfc3 Move event processing out of LibraryItemComponent 2019-03-12 14:38:25 -07:00
Christopher Willis-Ford db9236bef2 Fix sprite lib animation: move load into LibraryItem
The `LibraryItem` component has been split into a container, responsible
for handling interaction with the storage module, and a component,
responsible for presentation. The component now always takes an
`iconURI` and the logic to load an icon from storage has been moved from
`Library` into `LibraryItem`.

TODO: move animation logic from `SpriteLibrary` into `LibraryItem`. This
should simplify the code quite a bit and might also improve performance.
2019-03-12 14:38:25 -07:00
greenkeeper[bot] 65642edc15 chore(package): update react-intl to version 2.8.0
Closes #3120
2019-01-16 12:21:26 +00:00
Christopher Willis-Ford 86b6e12453 WIP: Load media libs with scratch-storage
The basics work but hover animations are broken
2018-12-20 18:45:55 -08:00
241 changed files with 20886 additions and 1898 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
last 3 versions
Safari >= 8
iOS >= 8
-1
View File
@@ -4,7 +4,6 @@
# NPM
/node_modules
npm-*
/package-lock.json
# Testing
/.nyc_output
+9 -1
View File
@@ -14,17 +14,24 @@ env:
cache:
directories:
- node_modules
before_install:
# package-lock.json was introduced in npm@5
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
- npm install -g greenkeeper-lockfile
install:
- npm --production=false install
- npm --production=false update
before_script: greenkeeper-lockfile-update
script:
- npm test
- if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ] && [ "$TRAVIS_BRANCH" == "master" ]; then npm run test:smoke; fi
after_script: greenkeeper-lockfile-upload
before_deploy:
- >
if [ -z "$BEFORE_DEPLOY_RAN" ]; then
npm --no-git-tag-version version $RELEASE_VERSION
if [ "$TRAVIS_BRANCH" == "master" ]; then export NPM_TAG=stable; fi
if [[ "$TRAVIS_BRANCH" == hotfix/* ]]; then export NPM_TAG=hotfix; fi # double brackets are important for matching the wildcard
git config --global user.email $(git log --pretty=format:"%ae" -n1)
git config --global user.name $(git log --pretty=format:"%an" -n1)
export BEFORE_DEPLOY_RAN=true
@@ -36,6 +43,7 @@ deploy:
- master
- develop
- smoke
- hotfix/*
condition: $TRAVIS_EVENT_TYPE != cron
skip_cleanup: true
email: $NPM_EMAIL
@@ -65,7 +73,7 @@ deploy:
- provider: script
on:
all_branches: true
condition: $TRAVIS_EVENT_TYPE != cron
condition: $TRAVIS_EVENT_TYPE != cron && ! $TRAVIS_BRANCH =~ ^greenkeeper/
skip_cleanup: true
script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- provider: script
+85 -16
View File
@@ -30,29 +30,38 @@ Then go to [http://localhost:8601/](http://localhost:8601/) - the playground out
## Developing alongside other Scratch repositories
### Linking this code to another project's `node_modules/scratch-gui`
### Getting another repo to point to this code
If you wish to develop `scratch-gui` alongside other scratch repositories that depend on it, you may wish
to have the other repositories use your local `scratch-gui` build instead of fetching the current production
version of the scratch-gui that is found by default using `npm install`.
Here's how to link your local `scratch-gui` code to another project's `node_modules/scratch-gui`.
#### Configuration
If you wish to develop scratch-gui alongside other scratch repositories that depend on it, you may wish
to have the other repositories use your local scratch-gui build instead of fetching the current production
version of the scratch-gui that is found by default using `npm install`.
1. In your local `scratch-gui` repository's top level:
1. Make sure you have run `npm install`
2. Build the `dist` directory by running `BUILD_MODE=dist npm run build`
3. Establish a link to this repository by running `npm link`
To do this:
1. Make sure you have run `npm install` from this (scratch-gui) repository's top level
2. Make sure you have run `npm install` from the top level of each repository (such as scratch-www) that depends on scratch-gui
3. From this (scratch-gui) repository's top level, build the `dist` directory by running `BUILD_MODE=dist npm run build`
4. From this (scratch-gui) repository's top level, establish a link to this repository by running `npm link`
5. From the top level of each repository that depends on scratch-gui, run `npm link scratch-gui`
6. Build or run the repositories that depend on scratch-gui
2. From the top level of each repository (such as `scratch-www`) that depends on `scratch-gui`:
1. Make sure you have run `npm install`
2. Run `npm link scratch-gui`
3. Build or run the repositoriy
Instead of `BUILD_MODE=dist npm run build` you can also use `BUILD_MODE=dist npm run watch`, however this may be unreliable.
#### Using `npm run watch`
Instead of `BUILD_MODE=dist npm run build`, you can use `BUILD_MODE=dist npm run watch` instead. This will watch for changes to your `scratch-gui` code, and automatically rebuild when there are changes. Sometimes this has been unreliable; if you are having problems, try going back to `BUILD_MODE=dist npm run build` until you resolve them.
#### Oh no! It didn't work!
* Follow the recipe above step by step and don't change the order. It is especially important to run npm first because installing after the linking will reset the linking.
* Make sure the repositories are siblings on your machine's file tree.
* If you have multiple Terminal tabs or windows open for the different Scratch repositories, make sure to use the same node version in all of them.
* In the worst case unlink the repositories by running `npm unlink` in both, and start over.
If you can't get linking to work right, try:
* Follow the recipe above step by step and don't change the order. It is especially important to run `npm install` _before_ `npm link`, because installing after the linking will reset the linking.
* Make sure the repositories are siblings on your machine's file tree, like `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-gui/` and `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-www/`.
* Consistent node.js version: If you have multiple Terminal tabs or windows open for the different Scratch repositories, make sure to use the same node version in all of them.
* If nothing else works, unlink the repositories by running `npm unlink` in both, and start over.
## Testing
### Documentation
@@ -121,6 +130,66 @@ If you want to watch the browser as it runs the test, rather than running headle
USE_HEADLESS=no $(npm bin)/jest --runInBand test/integration/backpack.test.js
```
## Troubleshooting
### Ignoring optional dependencies
When running `npm install`, you can get warnings about optionsl dependencies:
```
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.7
```
You can suppress them by adding the `no-optional` switch:
```
npm install --no-optional
```
Further reading: [Stack Overflow](https://stackoverflow.com/questions/36725181/not-compatible-with-your-operating-system-or-architecture-fsevents1-0-11)
### Resolving dependencies
When installing for the first time, you can get warnings which need to be resolved:
```
npm WARN eslint-config-scratch@5.0.0 requires a peer of babel-eslint@^8.0.1 but none was installed.
npm WARN eslint-config-scratch@5.0.0 requires a peer of eslint@^4.0 but none was installed.
npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-intl-redux@^0.7 but none was installed.
npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-responsive@^4 but none was installed.
```
You can check which versions are available:
```
npm view react-intl-redux@0.* version
```
You will neet do install the required version:
```
npm install --no-optional --save-dev react-intl-redux@^0.7
```
The dependency itself might have more missing dependencies, which will show up like this:
```
user@machine:~/sources/scratch/scratch-gui (491-translatable-library-objects)$ npm install --no-optional --save-dev react-intl-redux@^0.7
scratch-gui@0.1.0 /media/cuideigin/Linux/sources/scratch/scratch-gui
├── react-intl-redux@0.7.0
└── UNMET PEER DEPENDENCY react-responsive@5.0.0
```
You will need to install those as well:
```
npm install --no-optional --save-dev react-responsive@^5.0.0
```
Further reading: [Stack Overflow](https://stackoverflow.com/questions/46602286/npm-requires-a-peer-of-but-all-peers-are-in-package-json-and-node-modules)
## Publishing to GitHub Pages
You can publish the GUI to github.io so that others on the Internet can view it.
[Read the wiki for a step-by-step guide.](https://github.com/LLK/scratch-gui/wiki/Publishing-to-GitHub-Pages)
+14788
View File
File diff suppressed because it is too large. Load diff
+15 -12
View File
@@ -44,7 +44,7 @@
"babel-loader": "^8.0.4",
"base64-loader": "1.0.0",
"bowser": "1.9.4",
"chromedriver": "2.44.1",
"chromedriver": "76.0.0",
"classnames": "2.2.6",
"computed-style-to-inline-style": "3.0.0",
"copy-webpack-plugin": "^4.5.1",
@@ -55,8 +55,10 @@
"es6-object-assign": "1.1.0",
"eslint": "^5.0.1",
"eslint-config-scratch": "^5.0.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-react": "7.11.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.14.1",
"eslint-plugin-react": "^7.12.4",
"file-loader": "2.0.0",
"get-float-time-domain-data": "0.1.0",
"get-user-media-promise": "1.1.4",
@@ -90,8 +92,8 @@
"react-dom": "16.2.0",
"react-draggable": "3.0.5",
"react-ga": "2.5.3",
"react-intl": "2.4.0",
"react-modal": "3.6.1",
"react-intl": "2.9.0",
"react-modal": "3.9.1",
"react-popover": "0.5.10",
"react-redux": "5.0.7",
"react-responsive": "5.0.0",
@@ -100,18 +102,19 @@
"react-test-renderer": "16.2.0",
"react-tooltip": "3.8.0",
"react-virtualized": "9.20.1",
"react-visibility-sensor": "5.0.2",
"redux": "3.7.2",
"redux-mock-store": "^1.2.3",
"redux-throttle": "0.1.1",
"rimraf": "^2.6.1",
"scratch-audio": "0.1.0-prerelease.20190114210212",
"scratch-blocks": "0.1.0-prerelease.1552662801",
"scratch-l10n": "3.1.20190220143732",
"scratch-paint": "0.2.0-prerelease.20190311150519",
"scratch-render": "0.1.0-prerelease.20190312125229",
"scratch-storage": "1.2.2",
"scratch-svg-renderer": "0.2.0-prerelease.20190304180800",
"scratch-vm": "0.2.0-prerelease.20190318152140",
"scratch-l10n": "3.5.20190827223456",
"scratch-blocks": "0.1.0-prerelease.1566984014",
"scratch-paint": "0.2.0-prerelease.20190822205009",
"scratch-render": "0.1.0-prerelease.20190822204747",
"scratch-storage": "1.3.2",
"scratch-svg-renderer": "0.2.0-prerelease.20190822202608",
"scratch-vm": "0.2.0-prerelease.20190822194548",
"selenium-webdriver": "3.6.0",
"startaudiocontext": "1.2.1",
"style-loader": "^0.23.0",
+6
View File
@@ -1,3 +1,4 @@
const path = require('path');
module.exports = {
root: true,
extends: ['scratch', 'scratch/es6', 'scratch/react', 'plugin:import/errors'],
@@ -20,6 +21,11 @@ module.exports = {
settings: {
react: {
version: '16.2' // Prevent 16.3 lifecycle method errors
},
'import/resolver': {
webpack: {
config: path.resolve(__dirname, '../webpack.config.js')
}
}
}
};
+1 -1
View File
@@ -24,7 +24,7 @@
display: flex;
flex-grow: 1;
flex-shrink: 1;
overflow-y: auto;
overflow: visible;
}
[dir="ltr"] .detail-area {
@@ -0,0 +1,53 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import Box from '../box/box.jsx';
import styles from './audio-trimmer.css';
import SelectionHandle from './selection-handle.jsx';
import Playhead from './playhead.jsx';
const AudioSelector = props => (
<div
className={classNames(styles.absolute, styles.selector)}
ref={props.containerRef}
onMouseDown={props.onNewSelectionMouseDown}
onTouchStart={props.onNewSelectionMouseDown}
>
{props.trimStart === null ? null : (
<Box
className={classNames(styles.absolute)}
style={{
left: `${props.trimStart * 100}%`,
width: `${100 * (props.trimEnd - props.trimStart)}%`
}}
>
<Box className={classNames(styles.absolute, styles.selectionBackground)} />
<SelectionHandle
handleStyle={styles.leftHandle}
onMouseDown={props.onTrimStartMouseDown}
/>
<SelectionHandle
handleStyle={styles.rightHandle}
onMouseDown={props.onTrimEndMouseDown}
/>
</Box>
)}
{props.playhead ? (
<Playhead
playbackPosition={props.playhead}
/>
) : null}
</div>
);
AudioSelector.propTypes = {
containerRef: PropTypes.func,
onNewSelectionMouseDown: PropTypes.func.isRequired,
onTrimEndMouseDown: PropTypes.func.isRequired,
onTrimStartMouseDown: PropTypes.func.isRequired,
playhead: PropTypes.number,
trimEnd: PropTypes.number,
trimStart: PropTypes.number
};
export default AudioSelector;
+44 -20
View File
@@ -1,10 +1,11 @@
@import "../../css/colors.css";
$border-radius: 4px;
$trim-handle-width: 12px;
$trim-handle-height: 14px;
$trim-handle-width: 30px;
$trim-handle-height: 30px;
$trim-handle-border: 3px;
$stripe-size: 10px;
$hover-scale: 2;
$hover-scale: 1.25;
.absolute {
position: absolute;
@@ -17,6 +18,10 @@ $hover-scale: 2;
transform: translateZ(0);
}
.selector {
cursor: pointer;
}
.trim-background {
cursor: pointer;
touch-action: none;
@@ -35,6 +40,11 @@ $hover-scale: 2;
);
}
.selection-background {
background: $motion-primary;
opacity: 0.5;
}
.start-trim-background .trim-background-mask {
border-top-left-radius: $border-radius;
border-bottom-left-radius: $border-radius;
@@ -53,6 +63,10 @@ $hover-scale: 2;
border: 1px solid $red-tertiary;
}
.selector .trim-line {
border: 1px solid $motion-tertiary;
}
.playhead-container {
position: absolute;
top: 0;
@@ -68,31 +82,50 @@ $hover-scale: 2;
so that we can use transform: translateX() using percentages.
*/
width: 100%;
height: 100%;
border-left: 1px solid $motion-primary;
border-top: none;
border-bottom: none;
border-right: none;
}
.start-trim-line {
right: 0;
.right-handle {
transform: scaleX(-1);
}
.end-trim-line {
left: 0;
.selector .left-handle {
left: -1px
}
.selector .right-handle {
right: -1px
}
.trimmer .left-handle {
right: -1px
}
.trimmer .right-handle {
left: -1px
}
.trim-handle {
position: absolute;
left: calc(-$trim-handle-width / 2);
width: $trim-handle-width;
height: $trim-handle-height;
right: 0;
user-select: none;
}
.trimmer .trim-handle {
filter: hue-rotate(150deg);
}
.trim-handle img {
position: absolute;
width: $trim-handle-width;
height: $trim-handle-height;
left: calc($trim-handle-border * 1.5);
/* Make sure image dragging isn't triggered */
user-select: none;
@@ -103,22 +136,13 @@ $hover-scale: 2;
}
.top-trim-handle {
top: -$trim-handle-height;
top: calc(-$trim-handle-height + $trim-handle-border);
}
.bottom-trim-handle {
bottom: -$trim-handle-height;
bottom: calc(-$trim-handle-height + $trim-handle-border);
}
.top-trim-handle img {
transform: rotate(180deg);
}
/* Increase handle size when anywhere on draggable area is hovered */
.trim-background:hover img {
transform: scale($hover-scale);
}
.trim-background:hover .top-trim-handle img {
transform: rotate(180deg) scale($hover-scale);
transform: scaleY(-1);
}
+12 -28
View File
@@ -3,11 +3,12 @@ import React from 'react';
import classNames from 'classnames';
import Box from '../box/box.jsx';
import styles from './audio-trimmer.css';
import handleIcon from './icon--handle.svg';
import SelectionHandle from './selection-handle.jsx';
import Playhead from './playhead.jsx';
const AudioTrimmer = props => (
<div
className={styles.absolute}
className={classNames(styles.absolute, styles.trimmer)}
ref={props.containerRef}
>
{props.trimStart === null ? null : (
@@ -20,28 +21,16 @@ const AudioTrimmer = props => (
onTouchStart={props.onTrimStartMouseDown}
>
<Box className={classNames(styles.absolute, styles.trimBackgroundMask)} />
<Box className={classNames(styles.trimLine, styles.startTrimLine)}>
<Box className={classNames(styles.trimHandle, styles.topTrimHandle, styles.startTrimHandle)}>
<img src={handleIcon} />
</Box>
<Box className={classNames(styles.trimHandle, styles.bottomTrimHandle, styles.startTrimHandle)}>
<img src={handleIcon} />
</Box>
</Box>
<SelectionHandle
handleStyle={styles.leftHandle}
/>
</Box>
)}
{props.playhead ? (
<div className={styles.playheadContainer}>
<div
className={classNames(styles.trimLine, styles.playhead)}
style={{
transform: `translateX(${100 * props.playhead}%)`
}}
/>
</div>
<Playhead
playbackPosition={props.playhead}
/>
) : null}
{props.trimEnd === null ? null : (
<Box
className={classNames(styles.absolute, styles.trimBackground, styles.endTrimBackground)}
@@ -53,14 +42,9 @@ const AudioTrimmer = props => (
onTouchStart={props.onTrimEndMouseDown}
>
<Box className={classNames(styles.absolute, styles.trimBackgroundMask)} />
<Box className={classNames(styles.trimLine, styles.endTrimLine)}>
<Box className={classNames(styles.trimHandle, styles.topTrimHandle, styles.endTrimHandle)}>
<img src={handleIcon} />
</Box>
<Box className={classNames(styles.trimHandle, styles.bottomTrimHandle, styles.endTrimHandle)}>
<img src={handleIcon} />
</Box>
</Box>
<SelectionHandle
handleStyle={styles.rightHandle}
/>
</Box>
)}
</div>
+12 -14
View File
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="8px" height="10px" viewBox="0 0 8 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>handle</title>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="34px" height="34px" viewBox="1 1 33 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
<title>Bottom Left Handle</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Desktop---1280x720" transform="translate(-461.000000, -329.000000)" stroke="#E64D00" fill="#FF661A">
<g id="Step-5---Confirming-Trim" transform="translate(0.000000, 42.000000)">
<g id="Sound-Sketches" transform="translate(427.000000, 167.000000)">
<g id="start-playhead" transform="translate(35.000000, 0.000000)">
<path d="M0,122.213854 C0,121.658366 0.45097518,121.208054 0.990777969,121.208054 L5.00922203,121.208054 C5.55641359,121.208054 6,121.659838 6,122.213854 L6,126.298963 L3,129.208054 L0,126.298963 L0,122.213854 Z" id="handle" transform="translate(3.000000, 125.208054) scale(1, -1) translate(-3.000000, -125.208054) "></path>
</g>
</g>
</g>
<defs>
<path d="M17,5 C23.627417,5 29,10.372583 29,17 L29,29 L17,29 C10.372583,29 5,23.627417 5,17 C5,10.372583 10.372583,5 17,5 Z" id="path-1"></path>
</defs>
<g id="Bottom-Left-Handle" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Bottom-Left" transform="translate(17.000000, 17.000000) scale(1, -1) translate(-17.000000, -17.000000) ">
<use stroke="#4D97FF33" stroke-width="8" xlink:href="#path-1"></use>
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use stroke="#3D73CC" stroke-width="1" fill="#4D97FF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

+21
View File
@@ -0,0 +1,21 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import styles from './audio-trimmer.css';
const Playhead = props => (
<div className={styles.playheadContainer}>
<div
className={classNames(styles.playhead)}
style={{
transform: `translateX(${100 * props.playbackPosition}%)`
}}
/>
</div>
);
Playhead.propTypes = {
playbackPosition: PropTypes.number
};
export default Playhead;
@@ -0,0 +1,28 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import Box from '../box/box.jsx';
import styles from './audio-trimmer.css';
import handleIcon from './icon--handle.svg';
const SelectionHandle = props => (
<Box
className={classNames(styles.trimLine, props.handleStyle)}
onMouseDown={props.onMouseDown}
onTouchStart={props.onMouseDown}
>
<Box className={classNames(styles.trimHandle, styles.topTrimHandle)}>
<img src={handleIcon} />
</Box>
<Box className={classNames(styles.trimHandle, styles.bottomTrimHandle)}>
<img src={handleIcon} />
</Box>
</Box>
);
SelectionHandle.propTypes = {
handleStyle: PropTypes.string,
onMouseDown: PropTypes.func
};
export default SelectionHandle;
+48 -11
View File
@@ -2,10 +2,18 @@
@import "../../css/colors.css";
@import "../../css/z-index.css";
.card-container-overlay {
position: fixed;
pointer-events: none;
z-index: $z-index-card;
}
.card-container {
position:absolute;
pointer-events: auto;
z-index: $z-index-card;
margin: 0.5rem 2rem;
min-width: 468px;
}
.left-card, .right-card {
@@ -104,11 +112,38 @@
font-weight: bold;
}
.header-buttons-hidden {
border-bottom: 0px;
}
.header-buttons-right {
display: flex;
flex-direction: row;
}
.header-buttons img {
margin-bottom: 2px;
}
.shrink-expand-button {
cursor: pointer;
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 0.75rem;
}
.shrink-expand-button:hover, .all-button:hover {
background-color: $ui-black-transparent;
}
.remove-button, .all-button {
cursor: pointer;
color: white;
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 0.75rem;
@@ -127,6 +162,7 @@
}
.step-body {
width: 100%;
background: $ui-white;
display: flex;
flex-direction: column;
@@ -134,14 +170,19 @@
align-items: center;
position: relative;
text-align: center;
/* Min height prevents layout changing when images change */
min-height: 256px;
}
.step-video {
height: 337px;
height: 256px;
}
.step-image {
max-width: 450px;
max-height: 200px;
object-fit: contain;
background: #F9F9F9;
border: 1px solid #ddd;
border-radius: 0.5rem;
@@ -188,7 +229,7 @@
}
.close-icon {
height: 1rem;
height: 1.25rem;
margin: .125rem 0; /* To offset the .25rem difference in icon size */
}
@@ -240,14 +281,6 @@
margin-right: 0.5rem;
}
.video-cover {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.steps-list {
display: flex;
flex-direction: row;
@@ -267,3 +300,7 @@
background: $ui-white;
box-shadow: 0px 0px 0px 2px $ui-black-transparent;
}
.hidden {
display: none;
}
+203 -90
View File
@@ -1,10 +1,14 @@
import PropTypes from 'prop-types';
import React, {Fragment} from 'react';
import classNames from 'classnames';
import {FormattedMessage} from 'react-intl';
import Draggable from 'react-draggable';
import styles from './card.css';
import shrinkIcon from './icon--shrink.svg';
import expandIcon from './icon--expand.svg';
import rightArrow from './icon--next.svg';
import leftArrow from './icon--prev.svg';
@@ -14,8 +18,8 @@ import closeIcon from './icon--close.svg';
import {translateVideo} from '../../lib/libraries/decks/translate-video.js';
import {translateImage} from '../../lib/libraries/decks/translate-image.js';
const CardHeader = ({onCloseCards, onShowAll, totalSteps, step}) => (
<div className={styles.headerButtons}>
const CardHeader = ({onCloseCards, onShrinkExpandCards, onShowAll, totalSteps, step, expanded}) => (
<div className={expanded ? styles.headerButtons : classNames(styles.headerButtons, styles.headerButtonsHidden)}>
<div
className={styles.allButton}
onClick={onShowAll}
@@ -41,49 +45,107 @@ const CardHeader = ({onCloseCards, onShowAll, totalSteps, step}) => (
))}
</div>
) : null}
<div
className={styles.removeButton}
onClick={onCloseCards}
>
<FormattedMessage
defaultMessage="Close"
description="Title for button to close how-to card"
id="gui.cards.close"
/>
<img
className={styles.closeIcon}
src={closeIcon}
/>
<div className={styles.headerButtonsRight}>
<div
className={styles.shrinkExpandButton}
onClick={onShrinkExpandCards}
>
<img
draggable={false}
src={expanded ? shrinkIcon : expandIcon}
/>
{expanded ?
<FormattedMessage
defaultMessage="Shrink"
description="Title for button to shrink how-to card"
id="gui.cards.shrink"
/> :
<FormattedMessage
defaultMessage="Expand"
description="Title for button to expand how-to card"
id="gui.cards.expand"
/>
}
</div>
<div
className={styles.removeButton}
onClick={onCloseCards}
>
<img
className={styles.closeIcon}
src={closeIcon}
/>
<FormattedMessage
defaultMessage="Close"
description="Title for button to close how-to card"
id="gui.cards.close"
/>
</div>
</div>
</div>
);
// Video step needs to know if the card is being dragged to cover the video
// so that the mouseup is not swallowed by the iframe.
const VideoStep = ({video, dragging}) => (
<div className={styles.stepVideo}>
{dragging ? (
<div className={styles.videoCover} />
) : null}
<iframe
allowFullScreen
allowTransparency="true"
frameBorder="0"
height="338"
scrolling="no"
src={`https://fast.wistia.net/embed/iframe/${video}?seo=false&videoFoam=true`}
title="📹"
width="600"
/>
<script
async
src="https://fast.wistia.net/assets/external/E-v1.js"
/>
</div>
);
class VideoStep extends React.Component {
componentDidMount () {
const script = document.createElement('script');
script.src = `https://fast.wistia.com/embed/medias/${this.props.video}.jsonp`;
script.async = true;
script.setAttribute('id', 'wistia-video-content');
document.body.appendChild(script);
const script2 = document.createElement('script');
script2.src = 'https://fast.wistia.com/assets/external/E-v1.js';
script2.async = true;
script2.setAttribute('id', 'wistia-video-api');
document.body.appendChild(script2);
}
// We use the Wistia API here to update or pause the video dynamically:
// https://wistia.com/support/developers/player-api
componentDidUpdate (prevProps) {
// Ensure the wistia API is loaded and available
if (!(window.Wistia && window.Wistia.api)) return;
// Get a handle on the currently loaded video
const video = window.Wistia.api(prevProps.video);
// Reset the video source if a new video has been chosen from the library
if (prevProps.video !== this.props.video) {
video.replaceWith(this.props.video);
}
// Pause the video if the modal is being shrunken
if (!this.props.expanded) {
video.pause();
}
}
componentWillUnmount () {
const script = document.getElementById('wistia-video-content');
script.parentNode.removeChild(script);
const script2 = document.getElementById('wistia-video-api');
script2.parentNode.removeChild(script2);
}
render () {
return (
<div className={styles.stepVideo}>
<div
className={`wistia_embed wistia_async_${this.props.video}`}
id="video-div"
style={{height: `257px`, width: `466px`}}
>
&nbsp;
</div>
</div>
);
}
}
VideoStep.propTypes = {
dragging: PropTypes.bool.isRequired,
expanded: PropTypes.bool.isRequired,
video: PropTypes.string.isRequired
};
@@ -96,6 +158,7 @@ const ImageStep = ({title, image}) => (
<img
className={styles.stepImage}
draggable={false}
key={image} /* Use src as key to prevent hanging around on slow connections */
src={image}
/>
</div>
@@ -107,13 +170,13 @@ ImageStep.propTypes = {
title: PropTypes.node.isRequired
};
const NextPrevButtons = ({isRtl, onNextStep, onPrevStep}) => (
const NextPrevButtons = ({isRtl, onNextStep, onPrevStep, expanded}) => (
<Fragment>
{onNextStep ? (
<div>
<div className={isRtl ? styles.leftCard : styles.rightCard} />
<div className={expanded ? (isRtl ? styles.leftCard : styles.rightCard) : styles.hidden} />
<div
className={isRtl ? styles.leftButton : styles.rightButton}
className={expanded ? (isRtl ? styles.leftButton : styles.rightButton) : styles.hidden}
onClick={onNextStep}
>
<img
@@ -125,9 +188,9 @@ const NextPrevButtons = ({isRtl, onNextStep, onPrevStep}) => (
) : null}
{onPrevStep ? (
<div>
<div className={isRtl ? styles.rightCard : styles.leftCard} />
<div className={expanded ? (isRtl ? styles.rightCard : styles.leftCard) : styles.hidden} />
<div
className={isRtl ? styles.rightButton : styles.leftButton}
className={expanded ? (isRtl ? styles.rightButton : styles.leftButton) : styles.hidden}
onClick={onPrevStep}
>
<img
@@ -141,13 +204,16 @@ const NextPrevButtons = ({isRtl, onNextStep, onPrevStep}) => (
);
NextPrevButtons.propTypes = {
expanded: PropTypes.bool.isRequired,
isRtl: PropTypes.bool,
onNextStep: PropTypes.func,
onPrevStep: PropTypes.func
};
CardHeader.propTypes = {
expanded: PropTypes.bool.isRequired,
onCloseCards: PropTypes.func.isRequired,
onShowAll: PropTypes.func.isRequired,
onShrinkExpandCards: PropTypes.func.isRequired,
step: PropTypes.number,
totalSteps: PropTypes.number
};
@@ -219,78 +285,113 @@ const Cards = props => {
locale,
onActivateDeckFactory,
onCloseCards,
onShrinkExpandCards,
onDrag,
onStartDrag,
onEndDrag,
onShowAll,
onNextStep,
onPrevStep,
showVideos,
step,
expanded,
...posProps
} = props;
let {x, y} = posProps;
if (activeDeckId === null) return;
// Tutorial cards need to calculate their own dragging bounds
// to allow for dragging the cards off the left, right and bottom
// edges of the workspace.
const cardHorizontalDragOffset = 400; // ~80% of card width
const cardVerticalDragOffset = expanded ? 257 : 0; // ~80% of card height, if expanded
const menuBarHeight = 48; // TODO: get pre-calculated from elsewhere?
const wideCardWidth = 500;
if (x === 0 && y === 0) {
// initialize positions
x = isRtl ? -292 : 292;
// The tallest cards are about 385px high, and the default position is pinned
x = isRtl ? (-190 - wideCardWidth - cardHorizontalDragOffset) : 292;
x += cardHorizontalDragOffset;
// The tallest cards are about 320px high, and the default position is pinned
// to near the bottom of the blocks palette to allow room to work above.
const tallCardHeight = 385;
const tallCardHeight = 320;
const bottomMargin = 60; // To avoid overlapping the backpack region
y = window.innerHeight - tallCardHeight - bottomMargin;
y = window.innerHeight - tallCardHeight - bottomMargin - menuBarHeight;
}
const steps = content[activeDeckId].steps;
return (
<Draggable
bounds="parent"
position={{x: x, y: y}}
onDrag={onDrag}
onStart={onStartDrag}
onStop={onEndDrag}
// Custom overlay to act as the bounding parent for the draggable, using values from above
<div
className={styles.cardContainerOverlay}
style={{
width: `${window.innerWidth + (2 * cardHorizontalDragOffset)}px`,
height: `${window.innerHeight - menuBarHeight + cardVerticalDragOffset}px`,
top: `${menuBarHeight}px`,
left: `${-cardHorizontalDragOffset}px`
}}
>
<div className={styles.cardContainer}>
<div className={styles.card}>
<CardHeader
step={step}
totalSteps={steps.length}
onCloseCards={onCloseCards}
onShowAll={onShowAll}
/>
<div className={styles.stepBody}>
{steps[step].deckIds ? (
<PreviewsStep
content={content}
deckIds={steps[step].deckIds}
onActivateDeckFactory={onActivateDeckFactory}
onShowAll={onShowAll}
/>
) : (
steps[step].video ? (
<VideoStep
dragging={dragging}
video={translateVideo(steps[step].video, locale)}
<Draggable
bounds="parent"
cancel="#video-div" // disable dragging on video div
position={{x: x, y: y}}
onDrag={onDrag}
onStart={onStartDrag}
onStop={onEndDrag}
>
<div className={styles.cardContainer}>
<div className={styles.card}>
<CardHeader
expanded={expanded}
step={step}
totalSteps={steps.length}
onCloseCards={onCloseCards}
onShowAll={onShowAll}
onShrinkExpandCards={onShrinkExpandCards}
/>
<div className={expanded ? styles.stepBody : styles.hidden}>
{steps[step].deckIds ? (
<PreviewsStep
content={content}
deckIds={steps[step].deckIds}
onActivateDeckFactory={onActivateDeckFactory}
onShowAll={onShowAll}
/>
) : (
<ImageStep
image={translateImage(steps[step].image, locale)}
title={steps[step].title}
/>
)
)}
{steps[step].trackingPixel && steps[step].trackingPixel}
steps[step].video ? (
showVideos ? (
<VideoStep
dragging={dragging}
expanded={expanded}
video={translateVideo(steps[step].video, locale)}
/>
) : ( // Else show the deck image and title
<ImageStep
image={content[activeDeckId].img}
title={content[activeDeckId].name}
/>
)
) : (
<ImageStep
image={translateImage(steps[step].image, locale)}
title={steps[step].title}
/>
)
)}
{steps[step].trackingPixel && steps[step].trackingPixel}
</div>
<NextPrevButtons
expanded={expanded}
isRtl={isRtl}
onNextStep={step < steps.length - 1 ? onNextStep : null}
onPrevStep={step > 0 ? onPrevStep : null}
/>
</div>
<NextPrevButtons
isRtl={isRtl}
onNextStep={step < steps.length - 1 ? onNextStep : null}
onPrevStep={step > 0 ? onPrevStep : null}
/>
</div>
</div>
</Draggable>
</Draggable>
</div>
);
};
@@ -309,6 +410,7 @@ Cards.propTypes = {
})
}),
dragging: PropTypes.bool.isRequired,
expanded: PropTypes.bool.isRequired,
isRtl: PropTypes.bool.isRequired,
locale: PropTypes.string.isRequired,
onActivateDeckFactory: PropTypes.func.isRequired,
@@ -318,10 +420,21 @@ Cards.propTypes = {
onNextStep: PropTypes.func.isRequired,
onPrevStep: PropTypes.func.isRequired,
onShowAll: PropTypes.func,
onShrinkExpandCards: PropTypes.func.isRequired,
onStartDrag: PropTypes.func,
showVideos: PropTypes.bool,
step: PropTypes.number.isRequired,
x: PropTypes.number,
y: PropTypes.number
};
export default Cards;
Cards.defaultProps = {
showVideos: true
};
export {
Cards as default,
// Others exported for testability
ImageStep,
VideoStep
};
+6 -6
View File
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
<title>General/Check Copy</title>
<!-- Generator: Sketch 53.2 (72643) - https://sketchapp.com -->
<title>Extensions/Connection/Close</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M10,7.73577763 L12.2675846,5.46819305 C12.8909754,4.84480221 13.8988379,4.84194841 14.5284447,5.47155526 C15.1536925,6.096803 15.1476685,7.11655392 14.531807,7.73241542 L12.2642224,10 L14.531807,12.2675846 C15.1551978,12.8909754 15.1580516,13.8988379 14.5284447,14.5284447 C13.903197,15.1536925 12.8834461,15.1476685 12.2675846,14.531807 L10,12.2642224 L7.73241542,14.531807 C7.10902458,15.1551978 6.10116212,15.1580516 5.47155526,14.5284447 C4.84630752,13.903197 4.85233155,12.8834461 5.46819305,12.2675846 L7.73577763,10 L5.46819305,7.73241542 C4.84480221,7.10902458 4.84194841,6.10116212 5.47155526,5.47155526 C6.096803,4.84630752 7.11655392,4.85233155 7.73241542,5.46819305 L10,7.73577763 Z" id="path-1"></path>
<path d="M15.464935,15.467297 C14.7644059,16.1777705 13.6185877,16.1777705 12.9081142,15.467297 L9.99881899,12.5580018 L7.08841885,15.467297 C6.38236506,16.1733508 5.23765187,16.1733508 4.53159807,15.467297 C4.17912364,15.1148226 4.00012409,14.6485398 4.00012409,14.1888866 C4.00012409,13.7281285 4.17912364,13.2629506 4.53159807,12.9104762 L7.44089328,10.001181 L4.52717833,7.08636112 C4.17359897,6.73278176 3.99459941,6.26760391 4.00012409,5.80242606 C4.00012409,5.34166795 4.17359897,4.88201477 4.52717833,4.52954034 C5.23212719,3.82348655 6.37684038,3.82348655 7.08399911,4.52954034 L9.99881899,7.44325529 L12.9125339,4.52954034 C13.6185877,3.82348655 14.7644059,3.82348655 15.4704597,4.52954034 C16.1765134,5.2344892 16.1765134,6.38030733 15.4704597,7.08636112 L12.5545348,10.001181 L15.4704597,12.914896 C16.1765134,13.6209497 16.1765134,14.7557185 15.464935,15.467297" id="path-1"></path>
</defs>
<g id="General/Check-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Extensions/Connection/Close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="close-icon" fill="#FFFFFF" xlink:href="#path-1"></use>
<g id="Color/White" mask="url(#mask-2)" fill="#FFFFFF">
<use id="close" fill="#FFFFFF" xlink:href="#path-1"></use>
<g id="White" mask="url(#mask-2)" fill="#FFFFFF">
<rect id="Color" x="0" y="0" width="20" height="20"></rect>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 53.2 (72643) - https://sketchapp.com -->
<title>Tutorials/Expand</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M4.5,2 L15.5,2 C16.8807119,2 18,3.11928813 18,4.5 L18,5.5 C18,5.77614237 17.7761424,6 17.5,6 L2.5,6 C2.22385763,6 2,5.77614237 2,5.5 L2,4.5 C2,3.11928813 3.11928813,2 4.5,2 Z M2.5,7 L17.5,7 C17.7761424,7 18,7.22385763 18,7.5 L18,15.5 C18,16.8807119 16.8807119,18 15.5,18 L4.5,18 C3.11928813,18 2,16.8807119 2,15.5 L2,7.5 C2,7.22385763 2.22385763,7 2.5,7 Z M9.65509466,15.1636146 C9.745416,15.2533569 9.86700241,15.3031495 9.99727357,15.3031495 C10.1275447,15.3031495 10.2491311,15.2533569 10.3394525,15.1636146 L12.1574588,13.3456082 C12.3004676,13.2025994 12.3415754,12.9993764 12.2657286,12.8158388 C12.1898819,12.6334592 12.0109762,12.5153467 11.8100691,12.5153467 L11.1506075,12.5153467 L10.7899012,9.98808625 C10.7464775,9.64474938 10.4703026,9.36567961 10.1124912,9.30951827 C10.0783312,9.30546539 10.0435922,9.30314946 10.0094322,9.30314946 C9.61282891,9.30314946 9.27586085,9.59785176 9.22548933,9.98519134 L8.8740467,12.5153467 L8.18447804,12.5153467 C7.9858869,12.5153467 7.81450796,12.6265114 7.73692425,12.8065751 C7.65876155,12.9866388 7.69639544,13.1962306 7.83708829,13.3456082 L9.65509466,15.1636146 Z" id="path-1"></path>
</defs>
<g id="Tutorials/Expand" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Combined-Shape" fill-rule="nonzero"></g>
<g id="White" mask="url(#mask-2)" fill="#FFFFFF">
<rect id="Color" x="0" y="0" width="20" height="20"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 53.2 (72643) - https://sketchapp.com -->
<title>Tutorials/Shink</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M2.5,8 C2.22385763,8 2,7.77614237 2,7.5 C2,7.22385763 2.22385763,7 2.5,7 L3.5,7 C3.77614237,7 4,7.22385763 4,7.5 C4,7.77614237 3.77614237,8 3.5,8 L2.5,8 Z M5.5,8 C5.22385763,8 5,7.77614237 5,7.5 C5,7.22385763 5.22385763,7 5.5,7 L6.5,7 C6.77614237,7 7,7.22385763 7,7.5 C7,7.77614237 6.77614237,8 6.5,8 L5.5,8 Z M8.5,8 C8.22385763,8 8,7.77614237 8,7.5 C8,7.22385763 8.22385763,7 8.5,7 L9.5,7 C9.77614237,7 10,7.22385763 10,7.5 C10,7.77614237 9.77614237,8 9.5,8 L8.5,8 Z M11.5,8 C11.2238576,8 11,7.77614237 11,7.5 C11,7.22385763 11.2238576,7 11.5,7 L12.5,7 C12.7761424,7 13,7.22385763 13,7.5 C13,7.77614237 12.7761424,8 12.5,8 L11.5,8 Z M14.5,8 C14.2238576,8 14,7.77614237 14,7.5 C14,7.22385763 14.2238576,7 14.5,7 L15.5,7 C15.7761424,7 16,7.22385763 16,7.5 C16,7.77614237 15.7761424,8 15.5,8 L14.5,8 Z M17,7.5 C17,7.22385763 17.2238576,7 17.5,7 C17.7761424,7 18,7.22385763 18,7.5 L18,8.5 C18,8.77614237 17.7761424,9 17.5,9 C17.2238576,9 17,8.77614237 17,8.5 L17,7.5 Z M17,10.5 C17,10.2238576 17.2238576,10 17.5,10 C17.7761424,10 18,10.2238576 18,10.5 L18,11.5 C18,11.7761424 17.7761424,12 17.5,12 C17.2238576,12 17,11.7761424 17,11.5 L17,10.5 Z M17,13.5 C17,13.2238576 17.2238576,13 17.5,13 C17.7761424,13 18,13.2238576 18,13.5 L18,14.5 C18,14.7761424 17.7761424,15 17.5,15 C17.2238576,15 17,14.7761424 17,14.5 L17,13.5 Z M16.8130884,16.2258789 C16.9469778,15.9843665 17.2513011,15.8971208 17.4928135,16.0310102 C17.7343259,16.1648996 17.8215716,16.4692229 17.6876822,16.7107353 C17.4827416,17.0804113 17.1867239,17.3929429 16.8289716,17.6178178 C16.59518,17.7647739 16.286523,17.6943798 16.1395669,17.4605882 C15.9926108,17.2267966 16.0630049,16.9181396 16.2967965,16.7711835 C16.5118233,16.6360225 16.6900031,16.4479027 16.8130884,16.2258789 Z M14.5614675,17 C14.8376098,17 15.0614675,17.2238576 15.0614675,17.5 C15.0614675,17.7761424 14.8376098,18 14.5614675,18 L13.5614675,18 C13.2853251,18 13.0614675,17.7761424 13.0614675,17.5 C13.0614675,17.2238576 13.2853251,17 13.5614675,17 L14.5614675,17 Z M11.5614675,17 C11.8376098,17 12.0614675,17.2238576 12.0614675,17.5 C12.0614675,17.7761424 11.8376098,18 11.5614675,18 L10.5614675,18 C10.2853251,18 10.0614675,17.7761424 10.0614675,17.5 C10.0614675,17.2238576 10.2853251,17 10.5614675,17 L11.5614675,17 Z M8.56146746,17 C8.83760983,17 9.06146746,17.2238576 9.06146746,17.5 C9.06146746,17.7761424 8.83760983,18 8.56146746,18 L7.56146746,18 C7.28532508,18 7.06146746,17.7761424 7.06146746,17.5 C7.06146746,17.2238576 7.28532508,17 7.56146746,17 L8.56146746,17 Z M5.56146746,17 C5.83760983,17 6.06146746,17.2238576 6.06146746,17.5 C6.06146746,17.7761424 5.83760983,18 5.56146746,18 L4.56146746,18 C4.28532508,18 4.06146746,17.7761424 4.06146746,17.5 C4.06146746,17.2238576 4.28532508,17 4.56146746,17 L5.56146746,17 Z M3.22779886,16.2951753 C3.37445671,16.5291541 3.30366909,16.8377211 3.06969027,16.9843789 C2.83571145,17.1310368 2.52714447,17.0602491 2.38048662,16.8262703 C2.15682122,16.4694332 2.02609629,16.0609535 2.00352115,15.6335963 C1.98895424,15.3578384 2.20069137,15.1224836 2.47644927,15.1079167 C2.75220716,15.0933498 2.98756192,15.3050869 3.00212882,15.5808448 C3.01567642,15.8373067 3.0937811,16.0813625 3.22779886,16.2951753 Z M3,13.6229349 C3,13.8990773 2.77614237,14.1229349 2.5,14.1229349 C2.22385763,14.1229349 2,13.8990773 2,13.6229349 L2,12.6229349 C2,12.3467925 2.22385763,12.1229349 2.5,12.1229349 C2.77614237,12.1229349 3,12.3467925 3,12.6229349 L3,13.6229349 Z M3,10.6229349 C3,10.8990773 2.77614237,11.1229349 2.5,11.1229349 C2.22385763,11.1229349 2,10.8990773 2,10.6229349 L2,9.62293492 C2,9.34679254 2.22385763,9.12293492 2.5,9.12293492 C2.77614237,9.12293492 3,9.34679254 3,9.62293492 L3,10.6229349 Z M3,7.62293492 C3,7.89907729 2.77614237,8.12293492 2.5,8.12293492 C2.22385763,8.12293492 2,7.89907729 2,7.62293492 L2,7.5 C2,7.22385763 2.22385763,7 2.5,7 C2.77614237,7 3,7.22385763 3,7.5 L3,7.62293492 Z M4.5,2 L15.5,2 C16.8807119,2 18,3.11928813 18,4.5 L18,5.5 C18,5.77614237 17.7761424,6 17.5,6 L2.5,6 C2.22385763,6 2,5.77614237 2,5.5 L2,4.5 C2,3.11928813 3.11928813,2 4.5,2 Z M10.3449053,9.44268434 L12.1629117,11.2606907 C12.3036046,11.4100683 12.3412384,11.6196601 12.2630758,11.7997238 C12.185492,11.9797875 12.0141131,12.0909522 11.815522,12.0909522 L11.1259533,12.0909522 L10.7745107,14.6211076 C10.7241392,15.0084472 10.3871711,15.3031495 9.99056779,15.3031495 C9.9564078,15.3031495 9.92166882,15.3008335 9.88750883,15.2967806 C9.52969739,15.2406193 9.25352253,14.9615495 9.21009882,14.6182127 L8.84939246,12.0909522 L8.18993091,12.0909522 C7.98902384,12.0909522 7.81011812,11.9728397 7.73427135,11.7904601 C7.65842459,11.6069225 7.69953238,11.4036995 7.84254116,11.2606907 L9.66054753,9.44268434 C9.75086886,9.35294199 9.87245528,9.30314946 10.0027264,9.30314946 C10.1329976,9.30314946 10.254584,9.35294199 10.3449053,9.44268434 Z" id="path-1"></path>
</defs>
<g id="Tutorials/Shink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Rectangle" fill-rule="nonzero"></g>
<g id="White" mask="url(#mask-2)" fill="#FFFFFF">
<rect id="Color" x="0" y="0" width="20" height="20"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

@@ -45,8 +45,8 @@ const AutoScanningStep = props => (
src={radarIcon}
/>
<img
className={styles.peripheralButtonImage}
src={props.peripheralButtonImage}
className={styles.connectionTipIcon}
src={props.connectionTipIconURL}
/>
</React.Fragment>
)}
@@ -142,9 +142,9 @@ const AutoScanningStep = props => (
);
AutoScanningStep.propTypes = {
connectionTipIconURL: PropTypes.string,
onRefresh: PropTypes.func,
onStartScan: PropTypes.func,
peripheralButtonImage: PropTypes.string,
phase: PropTypes.oneOf(Object.keys(PHASES))
};
@@ -15,7 +15,7 @@ const ConnectedStep = props => (
<div className={styles.peripheralActivity}>
<img
className={styles.peripheralActivityIcon}
src={props.peripheralImage}
src={props.connectionIconURL}
/>
<img
className={styles.bluetoothConnectedIcon}
@@ -64,9 +64,9 @@ const ConnectedStep = props => (
);
ConnectedStep.propTypes = {
connectionIconURL: PropTypes.string.isRequired,
onCancel: PropTypes.func,
onDisconnect: PropTypes.func,
peripheralImage: PropTypes.string.isRequired
onDisconnect: PropTypes.func
};
export default ConnectedStep;
@@ -18,7 +18,7 @@ const ConnectingStep = props => (
<div className={styles.peripheralActivity}>
<img
className={styles.peripheralActivityIcon}
src={props.peripheralImage}
src={props.connectionIconURL}
/>
<img
className={styles.bluetoothConnectingIcon}
@@ -63,8 +63,8 @@ const ConnectingStep = props => (
ConnectingStep.propTypes = {
connectingMessage: PropTypes.node.isRequired,
onDisconnect: PropTypes.func,
peripheralImage: PropTypes.string.isRequired
connectionIconURL: PropTypes.string.isRequired,
onDisconnect: PropTypes.func
};
export default ConnectingStep;
@@ -162,7 +162,7 @@
height: 80px; */
}
.peripheral-button-image {
.connection-tip-icon {
position: absolute;
}
@@ -27,7 +27,7 @@ const ConnectionModalComponent = props => (
className={styles.modalContent}
contentLabel={props.name}
headerClassName={styles.header}
headerImage={props.smallPeripheralImage}
headerImage={props.connectionSmallIconURL}
id="connectionModal"
onHelp={props.onHelp}
onRequestClose={props.onCancel}
@@ -44,17 +44,21 @@ const ConnectionModalComponent = props => (
);
ConnectionModalComponent.propTypes = {
connectingMessage: PropTypes.node,
connectingMessage: PropTypes.node.isRequired,
connectionSmallIconURL: PropTypes.string,
connectionTipIconURL: PropTypes.string,
name: PropTypes.node,
onCancel: PropTypes.func.isRequired,
onHelp: PropTypes.func.isRequired,
peripheralButtonImage: PropTypes.string,
phase: PropTypes.oneOf(Object.keys(PHASES)).isRequired,
smallPeripheralImage: PropTypes.string,
title: PropTypes.string.isRequired,
useAutoScan: PropTypes.bool.isRequired
};
ConnectionModalComponent.defaultProps = {
connectingMessage: 'Connecting'
};
export {
ConnectionModalComponent as default,
PHASES
@@ -17,7 +17,7 @@ const ErrorStep = props => (
<div className={styles.peripheralActivity}>
<img
className={styles.peripheralActivityIcon}
src={props.peripheralImage}
src={props.connectionIconURL}
/>
</div>
</Box>
@@ -70,9 +70,9 @@ const ErrorStep = props => (
);
ErrorStep.propTypes = {
connectionIconURL: PropTypes.string.isRequired,
onHelp: PropTypes.func,
onScanning: PropTypes.func,
peripheralImage: PropTypes.string.isRequired
onScanning: PropTypes.func
};
export default ErrorStep;
@@ -23,7 +23,7 @@ class PeripheralTile extends React.Component {
<Box className={styles.peripheralTileName}>
<img
className={styles.peripheralTileImage}
src={this.props.smallPeripheralImage}
src={this.props.connectionSmallIconURL}
/>
<Box className={styles.peripheralTileNameWrapper}>
<Box className={styles.peripheralTileNameLabel}>
@@ -77,11 +77,11 @@ class PeripheralTile extends React.Component {
}
PeripheralTile.propTypes = {
connectionSmallIconURL: PropTypes.string,
name: PropTypes.string,
onConnecting: PropTypes.func,
peripheralId: PropTypes.string,
rssi: PropTypes.number,
smallPeripheralImage: PropTypes.string
rssi: PropTypes.number
};
export default PeripheralTile;
@@ -34,11 +34,11 @@ const ScanningStep = props => (
<div className={styles.peripheralTilePane}>
{props.peripheralList.map(peripheral =>
(<PeripheralTile
connectionSmallIconURL={props.connectionSmallIconURL}
key={peripheral.peripheralId}
name={peripheral.name}
peripheralId={peripheral.peripheralId}
rssi={peripheral.rssi}
smallPeripheralImage={props.smallPeripheralImage}
onConnecting={props.onConnecting}
/>)
)}
@@ -86,6 +86,7 @@ const ScanningStep = props => (
);
ScanningStep.propTypes = {
connectionSmallIconURL: PropTypes.string,
onConnecting: PropTypes.func,
onRefresh: PropTypes.func,
peripheralList: PropTypes.arrayOf(PropTypes.shape({
@@ -93,8 +94,7 @@ ScanningStep.propTypes = {
rssi: PropTypes.number,
peripheralId: PropTypes.string
})),
scanning: PropTypes.bool.isRequired,
smallPeripheralImage: PropTypes.string
scanning: PropTypes.bool.isRequired
};
ScanningStep.defaultProps = {
@@ -0,0 +1,36 @@
@import "../../css/colors.css";
@import "../../css/units.css";
/* wrapper to allow for touch slop if we decide to add it */
.delete-button {
display: flex;
align-items: center;
justify-content: center;
user-select: none;
cursor: pointer;
transition: all 0.15s ease-out;
}
.delete-button-visible {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden; /* Mask the icon animation */
width: 1.75rem;
height: 1.75rem;
box-shadow: 0px 0px 0px 2px $motion-transparent;
background-color: $motion-primary;
color: $ui-white;
border-radius: 50%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
user-select: none;
cursor: pointer;
transition: all 0.15s ease-out;
}
.delete-icon {
position: relative;
margin: 0.25rem;
user-select: none;
transform-origin: 50%;
}
@@ -0,0 +1,39 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import styles from './delete-button.css';
import deleteIcon from './icon--delete.svg';
const DeleteButton = props => (
<div
aria-label="Delete"
className={classNames(
styles.deleteButton,
props.className
)}
role="button"
tabIndex={props.tabIndex}
onClick={props.onClick}
>
<div className={styles.deleteButtonVisible}>
<img
className={styles.deleteIcon}
src={deleteIcon}
/>
</div>
</div>
);
DeleteButton.propTypes = {
className: PropTypes.string,
onClick: PropTypes.func.isRequired,
tabIndex: PropTypes.number
};
DeleteButton.defaultProps = {
tabIndex: 0
};
export default DeleteButton;
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55.1 (78136) - https://sketchapp.com -->
<title>Sound/General/Delete</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M4.54751641,6.99994966 L15.4523042,6.99994966 C15.7284466,6.99994966 15.9523042,7.22380729 15.9523042,7.49994966 C15.9523042,7.51506367 15.9516189,7.5301699 15.9502504,7.54522183 L15.1651793,16.1801783 C15.0715275,17.2102489 14.207924,17.9989808 13.1736049,17.9990897 L6.82662224,17.9997575 C5.79213514,17.9998663 4.92828345,17.2110677 4.83462539,16.180829 L4.04956981,7.54521753 C4.02456905,7.27020922 4.22724022,7.02700381 4.50224854,7.00200306 C4.51729904,7.00063483 4.53240384,6.99994966 4.54751641,6.99994966 Z M7.33333333,4 L7.88603796,2.34188612 C7.95409498,2.13771505 8.14516441,2 8.36037961,2 L11.6396204,2 C11.8548356,2 12.045905,2.13771505 12.113962,2.34188612 L12.6666667,4 L16.5,4 C16.7761424,4 17,4.22385763 17,4.5 L17,5.5 C17,5.77614237 16.7761424,6 16.5,6 L3.5,6 C3.22385763,6 3,5.77614237 3,5.5 L3,4.5 C3,4.22385763 3.22385763,4 3.5,4 L7.33333333,4 Z M8.38742589,4 L11.6125741,4 L11.2792408,3 L8.72075922,3 L8.38742589,4 Z M10,11.7204812 L11.5952436,10.1252376 C11.7905057,9.92997548 12.1070882,9.92997548 12.3023504,10.1252376 L12.3747624,10.1976496 C12.5700245,10.3929118 12.5700245,10.7094943 12.3747624,10.9047564 L10.7795188,12.5 L12.3747624,14.0952436 C12.5700245,14.2905057 12.5700245,14.6070882 12.3747624,14.8023504 L12.3023504,14.8747624 C12.1070882,15.0700245 11.7905057,15.0700245 11.5952436,14.8747624 L10,13.2795188 L8.40475641,14.8747624 C8.20949427,15.0700245 7.89291178,15.0700245 7.69764963,14.8747624 L7.62523762,14.8023504 C7.42997548,14.6070882 7.42997548,14.2905057 7.62523762,14.0952436 L9.22048121,12.5 L7.62523762,10.9047564 C7.42997548,10.7094943 7.42997548,10.3929118 7.62523762,10.1976496 L7.69764963,10.1252376 C7.89291178,9.92997548 8.20949427,9.92997548 8.40475641,10.1252376 L10,11.7204812 Z" id="path-1"></path>
</defs>
<g id="Sound/General/Delete" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Trash-Can"></g>
<g id="White" mask="url(#mask-2)" fill="#FFFFFF">
<rect id="Color" x="0" y="0" width="20" height="20"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+11
View File
@@ -66,8 +66,10 @@ const GUIComponent = props => {
backpackVisible,
blocksTabVisible,
cardsVisible,
canChangeLanguage,
canCreateNew,
canEditTitle,
canManageFiles,
canRemix,
canSave,
canCreateCopy,
@@ -85,6 +87,7 @@ const GUIComponent = props => {
isRtl,
isShared,
loading,
logo,
renderLogin,
onClickAccountNav,
onCloseAccountNav,
@@ -202,15 +205,18 @@ const GUIComponent = props => {
authorId={authorId}
authorThumbnailUrl={authorThumbnailUrl}
authorUsername={authorUsername}
canChangeLanguage={canChangeLanguage}
canCreateCopy={canCreateCopy}
canCreateNew={canCreateNew}
canEditTitle={canEditTitle}
canManageFiles={canManageFiles}
canRemix={canRemix}
canSave={canSave}
canShare={canShare}
className={styles.menuBarPosition}
enableCommunity={enableCommunity}
isShared={isShared}
logo={logo}
renderLogin={renderLogin}
showComingSoon={showComingSoon}
onClickAccountNav={onClickAccountNav}
@@ -359,9 +365,11 @@ GUIComponent.propTypes = {
backpackVisible: PropTypes.bool,
basePath: PropTypes.string,
blocksTabVisible: PropTypes.bool,
canChangeLanguage: PropTypes.bool,
canCreateCopy: PropTypes.bool,
canCreateNew: PropTypes.bool,
canEditTitle: PropTypes.bool,
canManageFiles: PropTypes.bool,
canRemix: PropTypes.bool,
canSave: PropTypes.bool,
canShare: PropTypes.bool,
@@ -378,6 +386,7 @@ GUIComponent.propTypes = {
isRtl: PropTypes.bool,
isShared: PropTypes.bool,
loading: PropTypes.bool,
logo: PropTypes.string,
onActivateCostumesTab: PropTypes.func,
onActivateSoundsTab: PropTypes.func,
onActivateTab: PropTypes.func,
@@ -411,8 +420,10 @@ GUIComponent.defaultProps = {
backpackHost: null,
backpackVisible: false,
basePath: './',
canChangeLanguage: true,
canCreateNew: false,
canEditTitle: false,
canManageFiles: true,
canRemix: false,
canSave: false,
canCreateCopy: false,
@@ -8,6 +8,7 @@
font-size: 0.75rem;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: $motion-primary;
border-radius: 0.5rem;
}
.container + .container {
@@ -16,4 +17,14 @@
.title {
margin-top: 0.5rem;
text-align: center;
}
.disabled {
opacity: 0.5;
pointer-events: none;
}
.container:active {
background-color: $motion-light-transparent;
}
+8 -2
View File
@@ -5,14 +5,19 @@ import styles from './icon-button.css';
const IconButton = ({
img,
disabled,
className,
title,
onClick
}) => (
<div
className={classNames(styles.container, className)}
className={classNames(
styles.container,
className,
disabled ? styles.disabled : null
)}
role="button"
onClick={onClick}
onClick={disabled ? null : onClick}
>
<img
className={styles.icon}
@@ -27,6 +32,7 @@ const IconButton = ({
IconButton.propTypes = {
className: PropTypes.string,
disabled: PropTypes.bool,
img: PropTypes.string,
onClick: PropTypes.func.isRequired,
title: PropTypes.node.isRequired
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.2 (81672) - https://sketch.com -->
<title>Sound/General/Library Tile Icon/RTL</title>
<desc>Created with Sketch.</desc>
<g id="Sound/General/Library-Tile-Icon/RTL" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M40.7941213,60.3333334 C39.5757531,60.3333334 38.3858512,59.7627412 37.7254274,58.7262523 C34.4973213,53.700852 34.4973213,47.4609802 37.7254274,42.43558 C38.7160634,40.8860816 40.8909074,40.373072 42.5989001,41.2839258 C44.2898131,42.2052491 44.8534507,44.2101744 43.8514282,45.7701424 C41.9441696,48.7382694 41.9441696,52.423563 43.8514282,55.3969245 C44.8534507,56.951658 44.2898131,58.956583 42.5989001,59.8779064 C42.0295692,60.1867593 41.4033053,60.3333334 40.7941213,60.3333334 Z M30.014623,64.6666666 C28.9761967,64.6666666 27.9668853,64.1309203 27.3991478,63.1577291 C22.8669507,55.401691 22.8669507,45.7582521 27.3991478,38.002214 C28.2531806,36.5473425 30.1068197,36.0705772 31.5528528,36.9208906 C32.9940332,37.7859493 33.4744267,39.6733502 32.6203939,41.1331368 C29.2188198,46.957538 29.2188198,54.202405 32.6203939,60.0317213 C33.4744267,61.491508 32.9940332,63.3739938 31.5528528,64.2390524 C31.0724594,64.5290438 30.5338363,64.6666666 30.014623,64.6666666 Z M48.8695653,34.1786293 C48.8695653,30.5538239 53.3068341,28.6536838 56.0736627,31.1003021 L62.1037975,36.4397458 C64.2189991,38.3098044 66.9754844,39.3476118 69.8405742,39.3476118 L70.8283578,39.3476118 C73.6831043,39.3476118 76,41.5936876 76,44.3611739 L76,54.689112 C76,57.4616116 73.6831043,59.7026738 70.8283578,59.7026738 L69.7836861,59.7026738 C66.9185963,59.7026738 64.1621111,60.7404813 62.0469094,62.6105398 L56.0736627,67.899848 C53.3068341,70.3464662 48.8695653,68.4463264 48.8695653,64.8165072 L48.8695653,34.1786293 Z" id="Shape" fill="#575E75" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.2 (81672) - https://sketch.com -->
<title>Sound/General/Library Tile Icon/LTR</title>
<desc>Created with Sketch.</desc>
<g id="Sound/General/Library-Tile-Icon/LTR" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M59.2058787,60.3333334 C58.5966947,60.3333334 57.9704308,60.1867593 57.4010999,59.8779064 C55.7101869,58.956583 55.1465493,56.951658 56.1485718,55.3969245 C58.0558304,52.423563 58.0558304,48.7382694 56.1485718,45.7701424 C55.1465493,44.2101744 55.7101869,42.2052491 57.4010999,41.2839258 C59.1090926,40.373072 61.2839366,40.8860816 62.2745726,42.43558 C65.5026787,47.4609802 65.5026787,53.700852 62.2745726,58.7262523 C61.6141488,59.7627412 60.4242469,60.3333334 59.2058787,60.3333334 Z M69.985377,64.6666666 C69.4661637,64.6666666 68.9275406,64.5290438 68.4471472,64.2390524 C67.0059668,63.3739938 66.5255733,61.491508 67.3796061,60.0317213 C70.7811802,54.202405 70.7811802,46.957538 67.3796061,41.1331368 C66.5255733,39.6733502 67.0059668,37.7859493 68.4471472,36.9208906 C69.8931803,36.0705772 71.7468194,36.5473425 72.6008522,38.002214 C77.1330493,45.7582521 77.1330493,55.401691 72.6008522,63.1577291 C72.0331147,64.1309203 71.0238033,64.6666666 69.985377,64.6666666 Z M51.1304347,34.1786293 L51.1304347,64.8165072 C51.1304347,68.4463264 46.6931659,70.3464662 43.9263373,67.899848 L37.9530906,62.6105398 C35.8378889,60.7404813 33.0814037,59.7026738 30.2163139,59.7026738 L29.1716422,59.7026738 C26.3168957,59.7026738 24,57.4616116 24,54.689112 L24,44.3611739 C24,41.5936876 26.3168957,39.3476118 29.1716422,39.3476118 L30.1594258,39.3476118 C33.0245156,39.3476118 35.7810009,38.3098044 37.8962025,36.4397458 L43.9263373,31.1003021 C46.6931659,28.6536838 51.1304347,30.5538239 51.1304347,34.1786293 Z" id="Combined-Shape" fill="#575E75" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -7,6 +7,7 @@
align-items: center;
justify-content: flex-start;
flex-basis: 160px;
position: relative;
height: 160px;
max-width: 160px;
margin: $space;
+35 -14
View File
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
import PlayButton from '../../containers/play-button.jsx';
import ScratchImage from '../scratch-image/scratch-image.jsx';
import styles from './library-item.css';
import classNames from 'classnames';
@@ -35,10 +37,12 @@ class LibraryItemComponent extends React.PureComponent {
/>
</div>
) : null}
<img
className={styles.featuredImage}
src={this.props.iconURL}
/>
{this.props.iconSource ? (
<ScratchImage
className={styles.featuredImage}
imageSource={this.props.iconSource}
/>
) : null}
</div>
{this.props.insetIconURL ? (
<div className={styles.libraryItemInsetImageContainer}>
@@ -106,8 +110,9 @@ class LibraryItemComponent extends React.PureComponent {
) : (
<Box
className={classNames(
styles.libraryItem,
this.props.hidden ? styles.hidden : null
styles.libraryItem, {
[styles.hidden]: this.props.hidden
}
)}
role="button"
tabIndex="0"
@@ -115,19 +120,30 @@ class LibraryItemComponent extends React.PureComponent {
onClick={this.props.onClick}
onFocus={this.props.onFocus}
onKeyPress={this.props.onKeyPress}
onMouseEnter={this.props.onMouseEnter}
onMouseLeave={this.props.onMouseLeave}
onMouseEnter={this.props.showPlayButton ? null : this.props.onMouseEnter}
onMouseLeave={this.props.showPlayButton ? null : this.props.onMouseLeave}
>
{/* Layers of wrapping is to prevent layout thrashing on animation */}
<Box className={styles.libraryItemImageContainerWrapper}>
<Box className={styles.libraryItemImageContainer}>
<img
<Box
className={styles.libraryItemImageContainer}
onMouseEnter={this.props.showPlayButton ? this.props.onMouseEnter : null}
onMouseLeave={this.props.showPlayButton ? this.props.onMouseLeave : null}
>
<ScratchImage
className={styles.libraryItemImage}
src={this.props.iconURL}
imageSource={this.props.iconSource}
/>
</Box>
</Box>
<span className={styles.libraryItemName}>{this.props.name}</span>
{this.props.showPlayButton ? (
<PlayButton
isPlaying={this.props.isPlaying}
onPlay={this.props.onPlay}
onStop={this.props.onStop}
/>
) : null}
</Box>
);
}
@@ -146,9 +162,10 @@ LibraryItemComponent.propTypes = {
extensionId: PropTypes.string,
featured: PropTypes.bool,
hidden: PropTypes.bool,
iconURL: PropTypes.string,
iconSource: ScratchImage.ImageSourcePropType,
insetIconURL: PropTypes.string,
internetConnectionRequired: PropTypes.bool,
isPlaying: PropTypes.bool,
name: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node
@@ -158,11 +175,15 @@ LibraryItemComponent.propTypes = {
onFocus: PropTypes.func.isRequired,
onKeyPress: PropTypes.func.isRequired,
onMouseEnter: PropTypes.func.isRequired,
onMouseLeave: PropTypes.func.isRequired
onMouseLeave: PropTypes.func.isRequired,
onPlay: PropTypes.func.isRequired,
onStop: PropTypes.func.isRequired,
showPlayButton: PropTypes.bool
};
LibraryItemComponent.defaultProps = {
disabled: false
disabled: false,
showPlayButton: false
};
export default LibraryItemComponent;
+9
View File
@@ -12,6 +12,7 @@
overflow-y: auto;
height: auto;
padding: 0.5rem;
height: calc(100% - $library-header-height);
}
.library-scroll-grid.withFilterBar {
@@ -59,3 +60,11 @@
height: $library-filter-bar-height;
overflow: hidden;
}
.spinner-wrapper {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
+122 -21
View File
@@ -9,6 +9,8 @@ import Modal from '../../containers/modal.jsx';
import Divider from '../divider/divider.jsx';
import Filter from '../filter/filter.jsx';
import TagButton from '../../containers/tag-button.jsx';
import Spinner from '../spinner/spinner.jsx';
import storage from '../../lib/storage';
import styles from './library.css';
@@ -28,6 +30,47 @@ const messages = defineMessages({
const ALL_TAG = {tag: 'all', intlLabel: messages.allTag};
const tagListPrefix = [ALL_TAG];
/**
* Find the AssetType which corresponds to a particular file extension. For example, 'png' => AssetType.ImageBitmap.
* @param {string} fileExtension - the file extension to look up.
* @returns {AssetType} - the AssetType corresponding to the extension, if any.
*/
const getAssetTypeForFileExtension = function (fileExtension) {
const compareOptions = {
sensitivity: 'accent',
usage: 'search'
};
for (const assetTypeId in storage.AssetType) {
const assetType = storage.AssetType[assetTypeId];
if (fileExtension.localeCompare(assetType.runtimeFormat, compareOptions) === 0) {
return assetType;
}
}
};
/**
* Figure out an `imageSource` (URI or asset ID & type) for a library item's icon.
* @param {object} item - either a library item or one of a library item's costumes.
* @returns {object} - an `imageSource` ready to be passed to a `ScratchImage`.
*/
const getItemImageSource = function (item) {
if (item.rawURL) {
return {
uri: item.rawURL
};
}
// TODO: adjust libraries to be more storage-friendly; don't use split() here.
const md5 = item.md5 || item.baseLayerMD5;
if (md5) {
const [assetId, fileExtension] = md5.split('.');
return {
assetId: assetId,
assetType: getAssetTypeForFileExtension(fileExtension)
};
}
};
class LibraryComponent extends React.Component {
constructor (props) {
super(props);
@@ -37,16 +80,25 @@ class LibraryComponent extends React.Component {
'handleFilterClear',
'handleMouseEnter',
'handleMouseLeave',
'handlePlayingEnd',
'handleSelect',
'handleTagClick',
'setFilteredDataRef'
]);
this.state = {
selectedItem: null,
playingItem: null,
filterQuery: '',
selectedTag: ALL_TAG.tag
selectedTag: ALL_TAG.tag,
loaded: false
};
}
componentDidMount () {
// Allow the spinner to display before loading the content
setTimeout(() => {
this.setState({loaded: true});
});
if (this.props.setStopHandler) this.props.setStopHandler(this.handlePlayingEnd);
}
componentDidUpdate (prevProps, prevState) {
if (prevState.filterQuery !== this.state.filterQuery ||
prevState.selectedTag !== this.state.selectedTag) {
@@ -61,22 +113,58 @@ class LibraryComponent extends React.Component {
this.props.onRequestClose();
}
handleTagClick (tag) {
this.setState({
filterQuery: '',
selectedTag: tag.toLowerCase()
});
if (this.state.playingItem === null) {
this.setState({
filterQuery: '',
selectedTag: tag.toLowerCase()
});
} else {
this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]);
this.setState({
filterQuery: '',
playingItem: null,
selectedTag: tag.toLowerCase()
});
}
}
handleMouseEnter (id) {
if (this.props.onItemMouseEnter) this.props.onItemMouseEnter(this.getFilteredData()[id]);
// don't restart if mouse over already playing item
if (this.props.onItemMouseEnter && this.state.playingItem !== id) {
this.props.onItemMouseEnter(this.getFilteredData()[id]);
this.setState({
playingItem: id
});
}
}
handleMouseLeave (id) {
if (this.props.onItemMouseLeave) this.props.onItemMouseLeave(this.getFilteredData()[id]);
if (this.props.onItemMouseLeave) {
this.props.onItemMouseLeave(this.getFilteredData()[id]);
this.setState({
playingItem: null
});
}
}
handlePlayingEnd () {
if (this.state.playingItem !== null) {
this.setState({
playingItem: null
});
}
}
handleFilterChange (event) {
this.setState({
filterQuery: event.target.value,
selectedTag: ALL_TAG.tag
});
if (this.state.playingItem === null) {
this.setState({
filterQuery: event.target.value,
selectedTag: ALL_TAG.tag
});
} else {
this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]);
this.setState({
filterQuery: event.target.value,
playingItem: null,
selectedTag: ALL_TAG.tag
});
}
}
handleFilterClear () {
this.setState({filterQuery: ''});
@@ -162,8 +250,10 @@ class LibraryComponent extends React.Component {
})}
ref={this.setFilteredDataRef}
>
{this.getFilteredData().map((dataItem, index) => (
<LibraryItem
{this.state.loaded ? this.getFilteredData().map((dataItem, index) => {
const iconSource = getItemImageSource(dataItem);
const icons = dataItem.json && dataItem.json.costumes.map(getItemImageSource);
return (<LibraryItem
bluetoothRequired={dataItem.bluetoothRequired}
collaborator={dataItem.collaborator}
description={dataItem.description}
@@ -171,19 +261,27 @@ class LibraryComponent extends React.Component {
extensionId={dataItem.extensionId}
featured={dataItem.featured}
hidden={dataItem.hidden}
iconMd5={dataItem.md5}
iconRawURL={dataItem.rawURL}
icons={dataItem.json && dataItem.json.costumes}
iconSource={iconSource}
icons={icons}
id={index}
insetIconURL={dataItem.insetIconURL}
internetConnectionRequired={dataItem.internetConnectionRequired}
key={`item_${index}`}
isPlaying={this.state.playingItem === index}
key={typeof dataItem.name === 'string' ? dataItem.name : dataItem.rawURL}
name={dataItem.name}
showPlayButton={this.props.showPlayButton}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onSelect={this.handleSelect}
/>
))}
/>);
}) : (
<div className={styles.spinnerWrapper}>
<Spinner
large
level="primary"
/>
</div>
)}
</div>
</Modal>
);
@@ -212,12 +310,15 @@ LibraryComponent.propTypes = {
onItemMouseLeave: PropTypes.func,
onItemSelected: PropTypes.func,
onRequestClose: PropTypes.func,
setStopHandler: PropTypes.func,
showPlayButton: PropTypes.bool,
tags: PropTypes.arrayOf(PropTypes.shape(TagButton.propTypes)),
title: PropTypes.string.isRequired
};
LibraryComponent.defaultProps = {
filterable: true
filterable: true,
showPlayButton: false
};
export default injectIntl(LibraryComponent);
+2 -1
View File
@@ -91,7 +91,8 @@ LoupeComponent.propTypes = {
color: PropTypes.shape({
r: PropTypes.number,
g: PropTypes.number,
b: PropTypes.number
b: PropTypes.number,
a: PropTypes.number
}),
data: PropTypes.instanceOf(Uint8Array),
width: PropTypes.number,
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.1 (47250) - http://www.bohemiancoding.com/sketch -->
<title>Feedback</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Feedback" fill="#4C97FF">
<path d="M12.3811686,14.2770244 C12.3811686,14.3987659 12.3515563,14.506558 12.306433,14.6257633 L11.4998525,16.6002595 C11.2770558,16.478518 10.93299,16.3846755 10.4704753,16.3846755 C10.0234717,16.3846755 9.6949171,16.478518 9.47071028,16.58631 L8.66412979,14.6257633 C8.60490535,14.506558 8.59080429,14.3848164 8.59080429,14.2643429 C8.60490535,14.2503934 8.60490535,14.2237624 8.60490535,14.2098129 L8.60490535,14.1705005 C8.60490535,13.9828155 8.67964095,13.7938625 8.813601,13.6188589 C9.1576668,13.1775457 9.79926492,12.9086997 10.4859864,12.9086997 C11.1727079,12.9086997 11.8143061,13.1775457 12.1428607,13.6188589 C12.2472085,13.7684996 12.3360452,13.9409669 12.3670675,14.103289 C12.3811686,14.1565509 12.3811686,14.2098129 12.3811686,14.2643429 L12.3811686,14.2770244 Z M8.60490535,5.94153049 C8.60490535,5.50782611 8.89115681,5.12865181 9.33393002,4.89024122 C9.59056927,4.7520138 9.91771381,4.9143359 9.91771381,5.18445004 L9.91771381,11.6621167 C9.91771381,11.8168299 9.80490535,11.9550573 9.63851287,11.9918334 C9.46789007,12.0311458 9.3029077,12.0831396 9.14638596,12.1452786 C8.89115681,12.2467299 8.60490535,12.0844078 8.60490535,11.8345839 L8.60490535,5.94153049 Z M12.3670675,5.94153049 L12.3670675,11.8333158 C12.3670675,12.0780671 12.0892767,12.2505343 11.8410981,12.1516193 C11.6775258,12.0844078 11.5054929,12.032414 11.3278196,11.9931016 C11.1529665,11.9550573 11.0373378,11.8054166 11.0373378,11.6443627 L11.0373378,5.18191375 C11.0373378,4.9143359 11.3630722,4.75074565 11.6211216,4.88770493 C12.0709453,5.12611553 12.3670675,5.50528983 12.3670675,5.94153049 Z M10.4859864,1.48528137 C8.82911216,1.48528137 7.48528137,2.53149809 7.48528137,3.82119796 L7.48528137,14.2237624 C7.48528137,14.4786589 7.5148936,14.7335553 7.62065153,14.9757703 L9.1576668,18.7066425 C9.3522614,19.177123 9.87400053,19.4852814 10.4859864,19.4852814 C11.0979723,19.4852814 11.6197115,19.177123 11.8143061,18.7066425 L13.3513213,14.9757703 C13.4556692,14.7335553 13.4852814,14.4786589 13.4852814,14.2237624 L13.4852814,3.82119796 C13.4852814,2.53149809 12.1428607,1.48528137 10.4859864,1.48528137 Z" id="feedback" transform="translate(10.485281, 10.485281) rotate(45.000000) translate(-10.485281, -10.485281) "></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

+101 -108
View File
@@ -1,5 +1,6 @@
import classNames from 'classnames';
import {connect} from 'react-redux';
import {compose} from 'redux';
import {defineMessages, FormattedMessage, injectIntl, intlShape} from 'react-intl';
import PropTypes from 'prop-types';
import bindAll from 'lodash.bindall';
@@ -27,6 +28,7 @@ import LoginDropdown from './login-dropdown.jsx';
import SB3Downloader from '../../containers/sb3-downloader.jsx';
import DeletionRestorer from '../../containers/deletion-restorer.jsx';
import TurboMode from '../../containers/turbo-mode.jsx';
import MenuBarHOC from '../../containers/menu-bar-hoc.jsx';
import {openTipsLibrary} from '../../reducers/modals';
import {setPlayer} from '../../reducers/mode';
@@ -63,7 +65,6 @@ import styles from './menu-bar.css';
import helpIcon from '../../lib/assets/icon--tutorials.svg';
import mystuffIcon from './icon--mystuff.png';
import feedbackIcon from './icon--feedback.svg';
import profileIcon from './icon--profile.png';
import remixIcon from './icon--remix.svg';
import dropdownCaret from './dropdown-caret.svg';
@@ -153,7 +154,7 @@ class MenuBar extends React.Component {
'handleKeyPress',
'handleLanguageMouseUp',
'handleRestoreOption',
'handleSaveToComputer',
'getSaveToComputerHandler',
'restoreOptionMessage'
]);
}
@@ -164,17 +165,14 @@ class MenuBar extends React.Component {
document.removeEventListener('keydown', this.handleKeyPress);
}
handleClickNew () {
let readyToReplaceProject = true;
// if the project is dirty, and user owns the project, we will autosave.
// but if they are not logged in and can't save, user should consider
// downloading or logging in first.
// Note that if user is logged in and editing someone else's project,
// they'll lose their work.
if (this.props.projectChanged && !this.props.canCreateNew) {
readyToReplaceProject = confirm( // eslint-disable-line no-alert
this.props.intl.formatMessage(sharedMessages.replaceProjectWarning)
);
}
const readyToReplaceProject = this.props.confirmReadyToReplaceProject(
this.props.intl.formatMessage(sharedMessages.replaceProjectWarning)
);
this.props.onRequestCloseFile();
if (readyToReplaceProject) {
this.props.onClickNew(this.props.canSave && this.props.canCreateNew);
@@ -194,8 +192,8 @@ class MenuBar extends React.Component {
this.props.onRequestCloseFile();
}
handleClickSeeCommunity (waitForUpdate) {
if (this.props.canSave) { // save before transitioning to project page
this.props.autoUpdateProject();
if (this.props.shouldSaveBeforeTransition()) {
this.props.autoUpdateProject(); // save before transitioning to project page
waitForUpdate(true); // queue the transition to project page
} else {
waitForUpdate(false); // immediately transition to project page
@@ -227,7 +225,7 @@ class MenuBar extends React.Component {
event.preventDefault();
}
}
handleSaveToComputer (downloadProjectCallback) {
getSaveToComputerHandler (downloadProjectCallback) {
return () => {
this.props.onRequestCloseFile();
downloadProjectCallback();
@@ -329,11 +327,11 @@ class MenuBar extends React.Component {
[styles.clickable]: typeof this.props.onClickLogo !== 'undefined'
})}
draggable={false}
src={scratchLogo}
src={this.props.logo}
onClick={this.props.onClickLogo}
/>
</div>
<div
{(this.props.canChangeLanguage) && (<div
className={classNames(styles.menuBarItem, styles.hoverable, styles.languageMenu)}
>
<div>
@@ -347,84 +345,86 @@ class MenuBar extends React.Component {
/>
</div>
<LanguageSelector label={this.props.intl.formatMessage(ariaMessages.language)} />
</div>
<div
className={classNames(styles.menuBarItem, styles.hoverable, {
[styles.active]: this.props.fileMenuOpen
})}
onMouseUp={this.props.onClickFile}
>
<FormattedMessage
defaultMessage="File"
description="Text for file dropdown menu"
id="gui.menuBar.file"
/>
<MenuBarMenu
className={classNames(styles.menuBarMenu)}
open={this.props.fileMenuOpen}
place={this.props.isRtl ? 'left' : 'right'}
onRequestClose={this.props.onRequestCloseFile}
</div>)}
{(this.props.canManageFiles) && (
<div
className={classNames(styles.menuBarItem, styles.hoverable, {
[styles.active]: this.props.fileMenuOpen
})}
onMouseUp={this.props.onClickFile}
>
<MenuSection>
<MenuItem
isRtl={this.props.isRtl}
onClick={this.handleClickNew}
>
{newProjectMessage}
</MenuItem>
</MenuSection>
{(this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && (
<FormattedMessage
defaultMessage="File"
description="Text for file dropdown menu"
id="gui.menuBar.file"
/>
<MenuBarMenu
className={classNames(styles.menuBarMenu)}
open={this.props.fileMenuOpen}
place={this.props.isRtl ? 'left' : 'right'}
onRequestClose={this.props.onRequestCloseFile}
>
<MenuSection>
{this.props.canSave ? (
<MenuItem onClick={this.handleClickSave}>
{saveNowMessage}
</MenuItem>
) : []}
{this.props.canCreateCopy ? (
<MenuItem onClick={this.handleClickSaveAsCopy}>
{createCopyMessage}
</MenuItem>
) : []}
{this.props.canRemix ? (
<MenuItem onClick={this.handleClickRemix}>
{remixMessage}
</MenuItem>
) : []}
<MenuItem
isRtl={this.props.isRtl}
onClick={this.handleClickNew}
>
{newProjectMessage}
</MenuItem>
</MenuSection>
)}
<MenuSection>
<SBFileUploader onUpdateProjectTitle={this.props.onUpdateProjectTitle}>
{(className, renderFileInput, loadProject) => (
{(this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && (
<MenuSection>
{this.props.canSave && (
<MenuItem onClick={this.handleClickSave}>
{saveNowMessage}
</MenuItem>
)}
{this.props.canCreateCopy && (
<MenuItem onClick={this.handleClickSaveAsCopy}>
{createCopyMessage}
</MenuItem>
)}
{this.props.canRemix && (
<MenuItem onClick={this.handleClickRemix}>
{remixMessage}
</MenuItem>
)}
</MenuSection>
)}
<MenuSection>
<SBFileUploader
canSave={this.props.canSave}
userOwnsProject={this.props.userOwnsProject}
onUpdateProjectTitle={this.props.onUpdateProjectTitle}
>
{(className, renderFileInput, handleLoadProject) => (
<MenuItem
className={className}
onClick={handleLoadProject}
>
{/* eslint-disable max-len */}
{this.props.intl.formatMessage(sharedMessages.loadFromComputerTitle)}
{/* eslint-enable max-len */}
{renderFileInput()}
</MenuItem>
)}
</SBFileUploader>
<SB3Downloader>{(className, downloadProjectCallback) => (
<MenuItem
className={className}
onClick={loadProject}
onClick={this.getSaveToComputerHandler(downloadProjectCallback)}
>
<FormattedMessage
defaultMessage="Load from your computer"
description={
'Menu bar item for uploading a project from your computer'
}
id="gui.menuBar.uploadFromComputer"
defaultMessage="Save to your computer"
description="Menu bar item for downloading a project to your computer" // eslint-disable-line max-len
id="gui.menuBar.downloadToComputer"
/>
{renderFileInput()}
</MenuItem>
)}
</SBFileUploader>
<SB3Downloader>{(className, downloadProjectCallback) => (
<MenuItem
className={className}
onClick={this.handleSaveToComputer(downloadProjectCallback)}
>
<FormattedMessage
defaultMessage="Save to your computer"
description="Menu bar item for downloading a project to your computer"
id="gui.menuBar.downloadToComputer"
/>
</MenuItem>
)}</SB3Downloader>
</MenuSection>
</MenuBarMenu>
</div>
)}</SB3Downloader>
</MenuSection>
</MenuBarMenu>
</div>
)}
<div
className={classNames(styles.menuBarItem, styles.hoverable, {
[styles.active]: this.props.editMenuOpen
@@ -646,25 +646,6 @@ class MenuBar extends React.Component {
) : (
// ******** no login session is available, so don't show login stuff
<React.Fragment>
<div className={classNames(styles.menuBarItem, styles.feedbackButtonWrapper)}>
<a
className={styles.feedbackLink}
href="https://scratch.mit.edu/discuss/topic/312261/"
rel="noopener noreferrer"
target="_blank"
>
<Button
className={styles.feedbackButton}
iconSrc={feedbackIcon}
>
<FormattedMessage
defaultMessage="Give Feedback"
description="Label for feedback form modal button"
id="gui.menuBar.giveFeedback"
/>
</Button>
</a>
</div>
{this.props.showComingSoon ? (
<React.Fragment>
<MenuBarItemTooltip id="mystuff">
@@ -721,13 +702,16 @@ MenuBar.propTypes = {
authorThumbnailUrl: PropTypes.string,
authorUsername: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
autoUpdateProject: PropTypes.func,
canChangeLanguage: PropTypes.bool,
canCreateCopy: PropTypes.bool,
canCreateNew: PropTypes.bool,
canEditTitle: PropTypes.bool,
canManageFiles: PropTypes.bool,
canRemix: PropTypes.bool,
canSave: PropTypes.bool,
canShare: PropTypes.bool,
className: PropTypes.string,
confirmReadyToReplaceProject: PropTypes.func,
editMenuOpen: PropTypes.bool,
enableCommunity: PropTypes.bool,
fileMenuOpen: PropTypes.bool,
@@ -737,7 +721,9 @@ MenuBar.propTypes = {
isShowingProject: PropTypes.bool,
isUpdating: PropTypes.bool,
languageMenuOpen: PropTypes.bool,
locale: PropTypes.string.isRequired,
loginMenuOpen: PropTypes.bool,
logo: PropTypes.string,
onClickAccount: PropTypes.func,
onClickEdit: PropTypes.func,
onClickFile: PropTypes.func,
@@ -761,20 +747,22 @@ MenuBar.propTypes = {
onShare: PropTypes.func,
onToggleLoginOpen: PropTypes.func,
onUpdateProjectTitle: PropTypes.func,
projectChanged: PropTypes.bool,
projectTitle: PropTypes.string,
renderLogin: PropTypes.func,
sessionExists: PropTypes.bool,
shouldSaveBeforeTransition: PropTypes.func,
showComingSoon: PropTypes.bool,
userOwnsProject: PropTypes.bool,
username: PropTypes.string,
vm: PropTypes.instanceOf(VM).isRequired
};
MenuBar.defaultProps = {
logo: scratchLogo,
onShare: () => {}
};
const mapStateToProps = state => {
const mapStateToProps = (state, ownProps) => {
const loadingState = state.scratchGui.projectState.loadingState;
const user = state.session && state.session.session && state.session.session.user;
return {
@@ -787,10 +775,11 @@ const mapStateToProps = state => {
languageMenuOpen: languageMenuOpen(state),
locale: state.locales.locale,
loginMenuOpen: loginMenuOpen(state),
projectChanged: state.scratchGui.projectChanged,
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
};
};
@@ -815,7 +804,11 @@ const mapDispatchToProps = dispatch => ({
onSeeCommunity: () => dispatch(setPlayer(true))
});
export default injectIntl(connect(
mapStateToProps,
mapDispatchToProps
)(MenuBar));
export default compose(
injectIntl,
MenuBarHOC,
connect(
mapStateToProps,
mapDispatchToProps
)
)(MenuBar);
+1 -1
View File
@@ -58,7 +58,7 @@ MenuItem.propTypes = {
const addDividerClassToFirstChild = (child, id) => (
React.cloneElement(child, {
child && React.cloneElement(child, {
className: classNames(
child.className,
{[styles.menuSection]: id === 0}
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="49px" height="52px" viewBox="-5 0 49 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>play</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M17.2214651,8.34499443 C19.7766419,4.08636653 23.9234057,4.09303946 26.4745787,8.34499443 L40.1520974,31.140859 C42.7072741,35.3994869 40.7489672,38.8517869 35.7726637,38.8517869 L7.92338006,38.8517869 C2.9495089,38.8517869 0.992773429,35.392814 3.54394641,31.140859 L17.2214651,8.34499443 Z" id="path-1"></path>
<filter x="-16.7%" y="-19.3%" width="133.5%" height="138.6%" filterUnits="objectBoundingBox" id="filter-2">
<feMorphology radius="2.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
<feOffset dx="0" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
<feComposite in="shadowOffsetOuter1" in2="SourceAlpha" operator="out" result="shadowOffsetOuter1"></feComposite>
<feColorMatrix values="0 0 0 0 0.298039216 0 0 0 0 0.592156863 0 0 0 0 1 0 0 0 0.1 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
</filter>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop---1280x720" transform="translate(-623.000000, -347.000000)">
<g id="Step-3---Altering-Suggested-Trim" transform="translate(0.000000, 42.000000)">
<g id="Play-/-Record-/-Stop" transform="translate(623.000000, 307.000000)">
<g id="play" transform="translate(21.849131, 22.002656) rotate(90.000000) translate(-21.849131, -22.002656) ">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use stroke="#FFFFFF" stroke-width="1" fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="52px" height="52px" viewBox="0 0 52 52" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>stop-playback</title>
<desc>Created with Sketch.</desc>
<defs>
<rect id="path-1" x="0" y="0" width="44" height="44" rx="4"></rect>
<filter x="-13.6%" y="-13.6%" width="127.3%" height="127.3%" filterUnits="objectBoundingBox" id="filter-2">
<feMorphology radius="2" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
<feOffset dx="0" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
<feComposite in="shadowOffsetOuter1" in2="SourceAlpha" operator="out" result="shadowOffsetOuter1"></feComposite>
<feColorMatrix values="0 0 0 0 0.298039216 0 0 0 0 0.592156863 0 0 0 0 1 0 0 0 0.1 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
</filter>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop---1280x720" transform="translate(-619.000000, -345.000000)">
<g id="Step-4---Playing-Trim" transform="translate(0.000000, 42.000000)">
<g id="Play-/-Record-/-Stop" transform="translate(623.000000, 307.000000)">
<g id="stop-playback">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
<rect stroke="#FFFFFF" stroke-width="1" x="0.5" y="0.5" width="43" height="43" rx="4"></rect>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,42 @@
@import "../../css/colors.css";
@import "../../css/units.css";
.play-button {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden; /* Mask the icon animation */
width: 2.5rem;
height: 2.5rem;
background-color: $sound-primary;
color: $ui-white;
border-radius: 50%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
user-select: none;
cursor: pointer;
transition: all 0.15s ease-out;
}
.play-button {
position: absolute;
top: .5rem;
z-index: auto;
}
.play-button:focus {
outline: none;
}
.play-icon {
width: 50%;
}
[dir="ltr"] .play-button {
right: .5rem;
}
[dir="rtl"] .play-button {
left: .5rem;
}
@@ -0,0 +1,73 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import {defineMessages, injectIntl, intlShape} from 'react-intl';
import styles from './play-button.css';
import playIcon from './icon--play.svg';
import stopIcon from './icon--stop.svg';
const messages = defineMessages({
play: {
id: 'gui.playButton.play',
description: 'Title of the button to start playing the sound',
defaultMessage: 'Play'
},
stop: {
id: 'gui.playButton.stop',
description: 'Title of the button to stop the sound',
defaultMessage: 'Stop'
}
});
const PlayButtonComponent = ({
className,
intl,
isPlaying,
onClick,
onMouseDown,
onMouseEnter,
onMouseLeave,
setButtonRef,
...props
}) => {
const label = isPlaying ?
intl.formatMessage(messages.stop) :
intl.formatMessage(messages.play);
return (
<div
aria-label={label}
className={classNames(styles.playButton, className, {
[styles.playing]: isPlaying
})}
onClick={onClick}
onMouseDown={onMouseDown}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
ref={setButtonRef}
{...props}
>
<img
className={styles.playIcon}
draggable={false}
src={isPlaying ? stopIcon : playIcon}
/>
</div>
);
};
PlayButtonComponent.propTypes = {
className: PropTypes.string,
intl: intlShape,
isPlaying: PropTypes.bool.isRequired,
onClick: PropTypes.func.isRequired,
onMouseDown: PropTypes.func.isRequired,
onMouseEnter: PropTypes.func.isRequired,
onMouseLeave: PropTypes.func.isRequired,
setButtonRef: PropTypes.func.isRequired
};
export default injectIntl(PlayButtonComponent);
@@ -0,0 +1,139 @@
import PropTypes from 'prop-types';
import React from 'react';
import VisibilitySensor from 'react-visibility-sensor';
import storage from '../../lib/storage';
class ScratchImage extends React.PureComponent {
static init () {
this._maxParallelism = 6;
this._currentJobs = 0;
this._pendingImages = new Set();
}
static loadPendingImages () {
if (this._currentJobs >= this._maxParallelism) {
// already busy
return;
}
// Find the first visible image. If there aren't any, find the first non-visible image.
let nextImage;
for (const image of this._pendingImages) {
if (image.isVisible) {
nextImage = image;
break;
} else {
nextImage = nextImage || image;
}
}
// If we found an image to load:
// 1) Remove it from the queue
// 2) Load the image
// 3) Pump the queue again
if (nextImage) {
this._pendingImages.delete(nextImage);
const imageSource = nextImage.props.imageSource;
++this._currentJobs;
storage
.load(imageSource.assetType, imageSource.assetId)
.then(asset => {
if (!nextImage.wasUnmounted) {
const dataURI = asset.encodeDataURI();
nextImage.setState({
imageURI: dataURI
});
}
--this._currentJobs;
this.loadPendingImages();
});
}
}
constructor (props) {
super(props);
this.state = {};
Object.assign(this.state, this._loadImageSource(props.imageSource));
}
componentWillReceiveProps (nextProps) {
const newState = this._loadImageSource(nextProps.imageSource);
this.setState(newState);
}
componentWillUnmount () {
this.wasUnmounted = true;
ScratchImage._pendingImages.delete(this);
}
/**
* Calculate the state changes necessary to load the image specified in the provided source info. If the component
* is mounted, call setState() with the return value of this function. If the component has not yet mounted, use
* the return value of this function as initial state for the component.
*
* @param {object} imageSource - the new source for the image, including either assetId or URI
* @returns {object} - the new state values, if any.
*/
_loadImageSource (imageSource) {
if (imageSource) {
if (imageSource.uri) {
ScratchImage._pendingImages.delete(this);
return {
imageURI: imageSource.uri,
lastRequestedAsset: null
};
}
if (this.state.lastRequestedAsset !== imageSource.assetId) {
ScratchImage._pendingImages.add(this);
return {
lastRequestedAsset: imageSource.assetId
};
}
}
// Nothing to do - don't change any state.
return {};
}
render () {
const {
src: _src,
imageSource: _imageSource,
...imgProps
} = this.props;
return (
<VisibilitySensor
intervalCheck
scrollCheck
>
{
({isVisible}) => {
this.isVisible = isVisible;
ScratchImage.loadPendingImages();
return (
<img
src={this.state.imageURI}
{...imgProps}
/>
);
}
}
</VisibilitySensor>
);
}
}
ScratchImage.ImageSourcePropType = PropTypes.oneOfType([
PropTypes.shape({
assetId: PropTypes.string.isRequired,
assetType: PropTypes.oneOf(Object.values(storage.AssetType)).isRequired
}),
PropTypes.shape({
uri: PropTypes.string.isRequired
})
]);
ScratchImage.propTypes = {
imageSource: ScratchImage.ImageSourcePropType.isRequired
};
ScratchImage.init();
export default ScratchImage;
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.1 (81669) - https://sketch.com -->
<title>Sound/General/Copy to New</title>
<desc>Created with Sketch.</desc>
<g id="Sound/General/Copy-to-New" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M15,11.0967026 L15,4 C15,3.44771525 14.5522847,3 14,3 L4,3 C3.44771525,3 3,3.44771525 3,4 L3,12 L12.6616037,12 L11.5236347,13.0430331 C11.1882084,13.3580017 11,13.7827132 11,14.2302292 C11,14.6767472 11.187801,15.1005394 11.5128606,15.4074032 L12.1595777,16 L4,16 C2.8954305,16 2,15.1045695 2,14 L2,4 C2,2.8954305 2.8954305,2 4,2 L14,2 C15.1045695,2 16,2.8954305 16,4 L16,12.0333493 C15.8307357,11.617882 15.4895036,11.283542 15.0505738,11.115203 C15.0337809,11.1087625 15.0169209,11.1025961 15,11.0967026 Z M10.3153901,9.43844107 C10.240142,9.43844107 10.1627842,9.41684419 10.0924589,9.37133647 C9.88359282,9.23558464 9.81397079,8.94017013 9.93774329,8.71108891 C10.173333,8.27298072 10.173333,7.72997337 9.93774329,7.2926365 C9.81397079,7.06278396 9.88359282,6.76736945 10.0924589,6.63161762 C10.3034348,6.49740842 10.5720773,6.57299751 10.6944433,6.80130741 C11.0931877,7.54177197 11.0931877,8.46118212 10.6944433,9.20164668 C10.612866,9.35436749 10.4658862,9.43844107 10.3153901,9.43844107 Z M11.6283181,10.2119951 C11.5530701,10.2119951 11.475009,10.1903983 11.405387,10.1448905 C11.1965209,10.0091387 11.1268989,9.7137242 11.2506714,9.48464298 C11.7436516,8.56986072 11.7436516,7.4329391 11.2506714,6.51892817 C11.1268989,6.28984695 11.1965209,5.99366112 11.405387,5.85790929 C11.6149563,5.7244714 11.8835989,5.79928918 12.0073714,6.02759908 C12.6642095,7.2447377 12.6642095,8.75806213 12.0073714,9.97520074 C11.9250908,10.1279216 11.7788142,10.2119951 11.6283181,10.2119951 Z M9.1892643,5.64286604 L9.1892643,10.3563857 C9.1892643,10.9148194 8.58587338,11.2071486 8.20963312,10.8307458 L7.39737611,10.0170061 C7.10974571,9.72930481 6.73491195,9.56964214 6.34530989,9.56964214 L6.20325282,9.56964214 C5.81505726,9.56964214 5.5,9.22486333 5.5,8.79832489 L5.5,7.20941137 C5.5,6.78364425 5.81505726,6.43809412 6.20325282,6.43809412 L6.33757411,6.43809412 C6.72717617,6.43809412 7.10200993,6.27843145 7.38964033,5.99073012 L8.20963312,5.16927725 C8.58587338,4.79287444 9.1892643,5.08520367 9.1892643,5.64286604 Z M13.937674,12.1868928 C14.1369962,12.0038895 14.4343459,11.9498886 14.6924846,12.0488903 C14.9506233,12.1478921 15.1172698,12.3758962 15.1172698,12.6339008 L15.1172698,13.2759122 C15.2675784,13.3119129 15.44076,13.3599137 15.6237444,13.428915 C15.9439671,13.545917 16.2968655,13.7259203 16.6236234,13.9686246 C16.7053128,14.0319257 16.7837347,14.0949268 16.8621566,14.1639281 C16.9307757,14.2239291 17.0418734,14.325931 17.0908871,14.385932 C17.2215902,14.5209344 17.3555609,14.6949375 17.4699262,14.8569404 C17.6921215,15.1989465 17.8456977,15.5679531 17.9273871,15.9186594 C18.005809,16.2699656 18.0123442,16.6029716 17.9862036,16.8789765 C17.9567954,17.1579815 17.8979789,17.3709853 17.8424301,17.5389883 C17.8162895,17.6229898 17.7934164,17.6589904 17.7803461,17.6979911 L17.7574731,17.7519921 C17.6921215,17.9109949 17.5156723,18.0159968 17.3196176,17.9979965 C17.0876195,17.9769961 16.9177054,17.7849927 16.9405785,17.5719889 L16.9471136,17.5149878 C16.9503812,17.4819873 16.9634515,17.4159861 16.960184,17.3649852 C16.960184,17.2629833 16.9569164,17.0889802 16.920973,16.8999769 C16.8817621,16.7079734 16.8098753,16.4919696 16.6922425,16.2849659 C16.5746097,16.0809623 16.4144984,15.8889588 16.2282464,15.730256 C16.1269515,15.6519546 16.0387269,15.5859534 15.921094,15.5139521 C15.8492073,15.4686513 15.8328694,15.4719514 15.774053,15.4389508 C15.7217718,15.4149504 15.6694905,15.39365 15.6172092,15.3729496 C15.4374924,15.3069485 15.2675784,15.2679478 15.1172698,15.2529475 L15.1172698,15.8259577 C15.1172698,16.0839623 14.9506233,16.3119664 14.6924846,16.4109681 C14.4343459,16.5099699 14.1369962,16.4559689 13.937674,16.2729657 L12.1993223,14.6802373 C12.0718867,14.5599351 12,14.3979322 12,14.2302292 C12,14.0619262 12.0718867,13.8999234 12.1993223,13.7802212 L13.937674,12.1868928 Z" id="Copy-to-New" fill="#4D97FF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.1 (81669) - https://sketch.com -->
<title>Sound/General/Copy</title>
<desc>Created with Sketch.</desc>
<g id="Sound/General/Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Secondary-Color" opacity="0.25" transform="translate(2.000000, 4.000000)" fill="#4D97FF">
<rect id="selection" x="0" y="0" width="16" height="12"></rect>
</g>
<g id="Primary-Color" transform="translate(0.000000, 2.000000)" fill="#4D97FF" fill-rule="nonzero">
<path d="M1.5,3.93699126 C0.637386394,3.71496986 0,2.93191971 0,2 C0,0.8954305 0.8954305,0 2,0 C3.1045695,0 4,0.8954305 4,2 C4,2.93191971 3.36261361,3.71496986 2.5,3.93699126 L2.5,12.0630087 C3.36261361,12.2850301 4,13.0680803 4,14 C4,15.1045695 3.1045695,16 2,16 C0.8954305,16 0,15.1045695 0,14 C0,13.0680803 0.637386394,12.2850301 1.5,12.0630087 L1.5,3.93699126 Z M17.5,12.0630087 L17.5,3.93699126 C16.6373864,3.71496986 16,2.93191971 16,2 C16,0.8954305 16.8954305,0 18,0 C19.1045695,0 20,0.8954305 20,2 C20,2.93191971 19.3626136,3.71496986 18.5,3.93699126 L18.5,12.0630087 C19.3626136,12.2850301 20,13.0680803 20,14 C20,15.1045695 19.1045695,16 18,16 C16.8954305,16 16,15.1045695 16,14 C16,13.0680803 16.6373864,12.2850301 17.5,12.0630087 Z M11,7 L12,7 C12.5522847,7 13,7.44771525 13,8 C13,8.55228475 12.5522847,9 12,9 L11,9 L11,10 C11,10.5522847 10.5522847,11 10,11 C9.44771525,11 9,10.5522847 9,10 L9,9 L8,9 C7.44771525,9 7,8.55228475 7,8 C7,7.44771525 7.44771525,7 8,7 L9,7 L9,6 C9,5.44771525 9.44771525,5 10,5 C10.5522847,5 11,5.44771525 11,6 L11,7 Z" id="handles-and-plus"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
<title>Sound/General/Trim</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M6.54210671,14.8773591 C6.54210671,15.6756813 5.89668548,16.3230878 5.11194905,16.3230878 C4.31632862,16.3230878 3.6709074,15.6756813 3.6709074,14.8773591 C3.6709074,14.086692 4.31632862,13.440379 5.11194905,13.440379 C5.89668548,13.440379 6.54210671,14.086692 6.54210671,14.8773591 L6.54210671,14.8773591 Z M8.63401159,13.5836396 C8.82992359,13.3878866 8.82992359,13.0685577 8.63401159,12.8706175 L7.10916313,11.338495 C6.91216272,11.1405548 6.59434991,11.1405548 6.3984379,11.338495 L5.87709428,11.861232 C5.63546947,11.7912421 5.37425346,11.7595279 5.11194905,11.7595279 C3.39010019,11.7595279 2.00021333,13.1571387 2.00021333,14.8872014 C2.00021333,16.8414505 3.794985,18.3779474 5.83246988,17.9230131 C7.36929074,17.5796252 8.34776238,16.1568618 8.19973997,14.5820892 C8.18450237,14.4213311 8.15620397,14.2638539 8.11266797,14.1074702 L8.63401159,13.5836396 Z M6.54210671,5.11617453 C6.54210671,5.91559037 5.89668548,6.5629969 5.11194905,6.5629969 C4.31632862,6.5629969 3.6709074,5.91559037 3.6709074,5.11617453 C3.6709074,4.32660102 4.31632862,3.68028808 5.11194905,3.68028808 C5.89668548,3.68028808 6.54210671,4.32660102 6.54210671,5.11617453 M18.0021973,16.1706411 L17.9368933,16.235163 C16.926858,17.2500165 15.2877276,17.2500165 14.2766039,16.235163 L7.87898848,9.80702856 C7.70919807,9.6353346 7.70919807,9.3586558 7.87898848,9.18805543 L9.15785853,7.90199109 C9.32764893,7.73139072 9.60301414,7.73139072 9.77280455,7.90199109 L18.0021973,16.1706411 Z M18.0021973,3.82934469 L12.4045559,9.45368895 L10.5107398,7.54865148 L14.2766039,3.76482275 C15.2877276,2.74996927 16.926858,2.74996927 17.9368933,3.76482275 L18.0021973,3.82934469 Z M8.63401159,6.41864274 C8.82992359,6.61548933 8.82992359,6.93591182 8.63401159,7.1327584 L7.10916313,8.66488096 C6.91216272,8.86282113 6.59434991,8.86282113 6.3984379,8.66488096 L5.87709428,8.14214392 C5.63546947,8.21213382 5.37425346,8.2427544 5.11194905,8.2427544 C3.39010019,8.2427544 2.00021333,6.84623726 2.00021333,5.11617453 C2.00021333,3.16192542 3.794985,1.62542849 5.83246988,2.0814564 C7.36929074,2.42375074 8.34776238,3.84651408 8.19973997,5.42128673 C8.18450237,5.58313837 8.15620397,5.73842845 8.11266797,5.89590571 L8.63401159,6.41864274 Z M10.3929749,10.0447755 C10.3929749,10.2744298 10.2079469,10.4614341 9.97829448,10.4614341 C9.74973047,10.4614341 9.56361406,10.2744298 9.56361406,10.0447755 C9.56361406,9.81402755 9.74973047,9.62811689 9.97829448,9.62811689 C10.2079469,9.62811689 10.3929749,9.81402755 10.3929749,10.0447755 Z" id="path-1"></path>
</defs>
<g id="Sound/General/Trim" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="Mask" fill="#575E75" xlink:href="#path-1"></use>
<g id="Blue/1_Blue" mask="url(#mask-2)" fill="#4D97FF">
<rect id="Primary-Blue" x="0" y="0" width="20" height="20"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.2 (81672) - https://sketch.com -->
<title>Sound/Effects/Fade-in</title>
<desc>Created with Sketch.</desc>
<g id="Sound/Effects/Fade-in" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M2,10.25 C1.86192881,10.25 1.75,10.1380712 1.75,10 C1.75,9.86192881 1.86192881,9.75 2,9.75 L7,9.75 C7.35324851,9.75 7.58270077,9.50876428 7.90437981,8.88536107 L8.04612021,8.6082292 C8.35582235,8.01071273 8.58718112,7.75 9,7.75 C9.3879427,7.75 9.64783618,7.89521764 10.0567568,8.24762061 L10.1299543,8.31093199 C10.5105228,8.64016497 10.7058526,8.75 11,8.75 C11.1999644,8.75 11.402585,8.39321162 11.7655628,7.41317141 C12.2359183,6.14321162 12.4592237,5.75 13,5.75 C13.4020616,5.75 13.6314717,5.8897049 13.9133418,6.21140451 C13.9679067,6.27426342 13.9973758,6.30824799 14.0201857,6.33390904 C14.2852046,6.63205537 14.5123572,6.75 15,6.75 C15.3765436,6.75 15.6926018,6.13162529 16.2628292,4.42094306 C16.9426018,2.38162529 17.2654325,1.75 18,1.75 C18.1380712,1.75 18.25,1.86192881 18.25,2 L18.25,18 C18.25,18.1380712 18.1380712,18.25 18,18.25 C17.2654325,18.25 16.9426018,17.6183747 16.2628292,15.5790569 C15.6926018,13.8683747 15.3765436,13.25 15,13.25 C14.5123572,13.25 14.2852046,13.3679446 14.0201857,13.666091 C13.9973758,13.691752 13.9679067,13.7257366 13.9133418,13.7885955 C13.6314717,14.1102951 13.4020616,14.25 13,14.25 C12.4592237,14.25 12.2359183,13.8567884 11.7655628,12.5868286 C11.402585,11.6067884 11.1999644,11.25 11,11.25 C10.7058526,11.25 10.5105228,11.359835 10.1299543,11.689068 L10.0567568,11.7523794 C9.64783618,12.1047824 9.3879427,12.25 9,12.25 C8.58718112,12.25 8.35582235,11.9892873 8.04612021,11.3917708 L7.90437981,11.1146389 C7.58270078,10.4912357 7.35324851,10.25 7.00000001,10.25 L2,10.25 Z" id="Path" fill="#CF63CF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.2 (81672) - https://sketch.com -->
<title>Sound/Effects/Fade-out</title>
<desc>Created with Sketch.</desc>
<g id="Sound/Effects/Fade-out" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M13,10.25 C12.6467515,10.25 12.4172992,10.4912357 12.0956202,11.1146389 L11.9538798,11.3917708 C11.6441776,11.9892873 11.4128189,12.25 11,12.25 C10.6120573,12.25 10.3521638,12.1047824 9.94324322,11.7523794 L9.8700457,11.689068 C9.48947724,11.359835 9.29414743,11.25 9,11.25 C8.80003561,11.25 8.59741505,11.6067884 8.23443719,12.5868286 C7.76408171,13.8567884 7.54077635,14.25 7,14.25 C6.59793845,14.25 6.3685283,14.1102951 6.08665816,13.7885955 C6.03209329,13.7257366 6.00262416,13.691752 5.97981434,13.666091 C5.71479538,13.3679446 5.48764275,13.25 5,13.25 C4.62345642,13.25 4.30739824,13.8683747 3.73717082,15.5790569 C3.05739824,17.6183747 2.73456753,18.25 2,18.25 C1.86192881,18.25 1.75,18.1380712 1.75,18 L1.75,2 C1.75,1.86192881 1.86192881,1.75 2,1.75 C2.73456753,1.75 3.05739824,2.38162529 3.73717082,4.42094306 C4.30739824,6.13162529 4.62345642,6.75 5,6.75 C5.48764275,6.75 5.71479538,6.63205537 5.97981434,6.33390904 C6.00262416,6.30824799 6.03209329,6.27426342 6.08665816,6.21140451 C6.3685283,5.8897049 6.59793845,5.75 7,5.75 C7.54077635,5.75 7.76408171,6.14321162 8.23443719,7.41317141 C8.59741505,8.39321162 8.80003561,8.75 9,8.75 C9.29414743,8.75 9.48947724,8.64016497 9.8700457,8.31093199 L9.94324322,8.24762061 C10.3521638,7.89521764 10.6120573,7.75 11,7.75 C11.4128189,7.75 11.6441776,8.01071273 11.9538798,8.6082292 L12.0956202,8.88536107 C12.4172992,9.50876428 12.6467515,9.75 13,9.75 L18,9.75 C18.1380712,9.75 18.25,9.86192881 18.25,10 C18.25,10.1380712 18.1380712,10.25 18,10.25 L12.9999998,10.25 L13,10.25 Z" id="Path" fill="#CF63CF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>icon--lounder</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="lounder">
<g id="louder" transform="translate(2.000000, 3.000000)">
<path d="M7.54011246,2.3873625 L7.54011246,11.8531125 C7.54011246,12.2457375 7.22294659,12.5629875 6.83155041,12.5629875 L5.50777655,12.5629875 C5.2018577,12.5629875 4.9296799,12.3661125 4.83408026,12.0736125 C4.29422346,10.4266125 2.75788098,9.3128625 1.02471572,9.3128625 L0.709799251,9.3128625 C0.319527773,9.3128625 0.0001125,8.9933625 0.0001125,8.6029875 L0.0001125,5.6374875 C0.0001125,5.2471125 0.319527773,4.9276125 0.709799251,4.9276125 L1.02471572,4.9276125 C2.75788098,4.9276125 4.29422346,3.8138625 4.83408026,2.1668625 C4.9296799,1.8743625 5.2018577,1.6774875 5.50777655,1.6774875 L6.83155041,1.6774875 C7.22294659,1.6774875 7.54011246,1.9947375 7.54011246,2.3873625" id="Fill-1" fill="#CF63CF"></path>
<path d="M9.25,5.8645125 C9.9385,6.5541375 9.9385,7.6858875 9.25,8.3755125" id="Stroke-3" stroke="#CF63CF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M10.75,3.3541875 C12.829,5.4331875 12.829,8.8081875 10.75,10.8860625" id="Stroke-5" stroke="#CF63CF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M12.5,0.8438625 C15.968375,4.3111125 15.968375,9.9293625 12.5,13.3966125" id="Stroke-7" stroke="#CF63CF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
<title>Sound/Effects/Mute</title>
<desc>Created with Sketch.</desc>
<g id="Sound/Effects/Mute" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path fill="#CF63CF" d="M13.4541749,5.04815243 L15.6281168,2.87421054 C15.92101,2.58131732 16.3958837,2.58131732 16.688777,2.87421054 C16.9816702,3.16710376 16.9816702,3.64197749 16.688777,3.93487071 L4.53033009,16.0933176 C4.23743687,16.3862108 3.76256313,16.3862108 3.46966991,16.0933176 C3.1767767,15.8004244 3.1767767,15.3255506 3.46966991,15.0326574 L6.31214932,12.190178 C6.1241191,12.0621379 6,11.8463331 6,11.6029875 L6,8.6374875 C6,8.2471125 6.31941527,7.9276125 6.70968675,7.9276125 L7.02460322,7.9276125 C8.75776848,7.9276125 10.294111,6.8138625 10.8339678,5.1668625 C10.9295674,4.8743625 11.2017452,4.6774875 11.5076641,4.6774875 L12.8314379,4.6774875 C13.1002844,4.6774875 13.3341075,4.82717208 13.4541749,5.04815243 Z M13.54,9.08364771 L13.54,14.8531125 C13.54,15.2457375 13.2228341,15.5629875 12.8314379,15.5629875 L11.5076641,15.5629875 C11.2017452,15.5629875 10.9295674,15.3661125 10.8339678,15.0736125 C10.5773785,14.2908077 10.0956813,13.628465 9.47473531,13.1489124 L13.54,9.08364771 Z" id="path-1"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 56.1 (81669) - https://sketch.com -->
<title>Sound/General/Paste</title>
<desc>Created with Sketch.</desc>
<g id="Sound/General/Paste" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M2.39776184,8.69699508 C2.82037272,8.57348907 3.12697047,8.23068036 3.44607843,7.63235294 C3.50283588,7.52593273 3.70653958,7.12084014 3.75472041,7.03050109 C4.03665487,6.50187397 4.27845388,6.25 4.66666667,6.25 C5.08719776,6.25 5.31070056,6.3254322 5.67812087,6.53210612 C5.97736723,6.7004322 6.1242348,6.75 6.44444444,6.75 C6.611898,6.75 6.70455317,6.61444047 6.85968251,6.13575567 C6.89349476,6.03068757 6.91177802,5.97409653 6.92949584,5.92094306 C7.19192893,5.1336438 7.51873661,4.75 8.22222222,4.75 C8.89163675,4.75 9.21925695,5.04485818 9.76356813,5.86132495 C10.2192569,6.54485818 10.4471923,6.75 10.8888889,6.75 C11.3661624,6.75 11.5487705,6.64281697 11.7364319,6.36132495 C11.7692531,6.31129826 11.7692531,6.31129826 11.8038172,6.25761214 C12.0332099,5.90369189 12.2433073,5.75 12.6666667,5.75 C13.1851992,5.75 13.4061497,6.04828312 13.7840084,6.89846538 C14.0728163,7.54828312 14.2222362,7.75 14.4444444,7.75 C14.7687569,7.75 14.9402848,7.69488783 15.2489243,7.52961059 L15.2905031,7.50732887 C15.6361057,7.32238348 15.857036,7.25 16.2222222,7.25 C16.6365912,7.25 16.8489777,7.46586974 17.1158999,7.96477614 C17.1606386,8.04903257 17.1606386,8.04903257 17.2045543,8.13123692 C17.3511621,8.40280419 17.4762139,8.57093888 17.631381,8.6621791 C17.7227849,8.5624959 17.8540941,8.5 18,8.5 C18.2761424,8.5 18.5,8.72385763 18.5,9 C18.5,9.27614237 18.2761424,9.5 18,9.5 C17.8540941,9.5 17.7227849,9.4375041 17.631381,9.3378209 C17.4762139,9.42906112 17.3511621,9.59719581 17.2045543,9.86876308 C17.1606386,9.95096743 17.1606386,9.95096743 17.1158999,10.0352239 C16.8489777,10.5341303 16.6365912,10.75 16.2222222,10.75 C15.857036,10.75 15.6361057,10.6776165 15.2905031,10.4926711 L15.2489243,10.4703894 C14.9402848,10.3051122 14.7687569,10.25 14.4444444,10.25 C14.2222362,10.25 14.0728163,10.4517169 13.7840084,11.1015346 C13.4061497,11.9517169 13.1851992,12.25 12.6666667,12.25 C12.2433073,12.25 12.0332099,12.0963081 11.8038172,11.7423879 C11.7692531,11.6887017 11.7692531,11.6887017 11.7364319,11.638675 C11.5487705,11.357183 11.3661624,11.25 10.8888889,11.25 C10.4471923,11.25 10.2192569,11.4551418 9.76356813,12.138675 C9.21925695,12.9551418 8.89163675,13.25 8.22222222,13.25 C7.51873661,13.25 7.19192893,12.8663562 6.92949584,12.0790569 C6.91177802,12.0259035 6.89349476,11.9693124 6.85968251,11.8642443 C6.70455317,11.3855595 6.611898,11.25 6.44444444,11.25 C6.1242348,11.25 5.97736723,11.2995678 5.67812087,11.4678939 C5.31070056,11.6745678 5.08719776,11.75 4.66666667,11.75 C4.2576716,11.75 4.07414298,11.4976192 3.8822771,10.9321841 L3.78515608,10.639352 C3.74630783,10.5239258 3.71290663,10.4315854 3.67737933,10.3436452 C3.42795496,9.72624902 3.07265238,9.37546644 2.4155666,9.27813036 C2.32583908,9.41193093 2.17320436,9.5 2,9.5 C1.72385763,9.5 1.5,9.27614237 1.5,9 C1.5,8.72385763 1.72385763,8.5 2,8.5 C2.16222865,8.5 2.306412,8.5772611 2.39776184,8.69699508 Z M9,15 L9.7763932,13.4472136 C9.80058413,13.3988317 9.83981475,13.3596011 9.8881966,13.3354102 C10.0116912,13.2736629 10.1618595,13.323719 10.2236068,13.4472136 L11,15 L12,15 C12.2761424,15 12.5,15.2238576 12.5,15.5 C12.5,15.6081851 12.4649111,15.7134519 12.4,15.8 L10.4,18.4666667 C10.2343146,18.6875806 9.9209139,18.7323521 9.7,18.5666667 C9.66209717,18.5382395 9.62842712,18.5045695 9.6,18.4666667 L7.6,15.8 C7.43431458,15.5790861 7.4790861,15.2656854 7.7,15.1 C7.78654809,15.0350889 7.89181489,15 8,15 L9,15 L9,15 Z M2,3.5 C1.72385763,3.5 1.5,3.27614237 1.5,3 C1.5,2.72385763 1.72385763,2.5 2,2.5 C2.27614237,2.5 2.5,2.72385763 2.5,3 C2.5,3.27614237 2.27614237,3.5 2,3.5 Z M4,3.5 C3.72385763,3.5 3.5,3.27614237 3.5,3 C3.5,2.72385763 3.72385763,2.5 4,2.5 C4.27614237,2.5 4.5,2.72385763 4.5,3 C4.5,3.27614237 4.27614237,3.5 4,3.5 Z M6,3.5 C5.72385763,3.5 5.5,3.27614237 5.5,3 C5.5,2.72385763 5.72385763,2.5 6,2.5 C6.27614237,2.5 6.5,2.72385763 6.5,3 C6.5,3.27614237 6.27614237,3.5 6,3.5 Z M8,3.5 C7.72385763,3.5 7.5,3.27614237 7.5,3 C7.5,2.72385763 7.72385763,2.5 8,2.5 C8.27614237,2.5 8.5,2.72385763 8.5,3 C8.5,3.27614237 8.27614237,3.5 8,3.5 Z M10,3.5 C9.72385763,3.5 9.5,3.27614237 9.5,3 C9.5,2.72385763 9.72385763,2.5 10,2.5 C10.2761424,2.5 10.5,2.72385763 10.5,3 C10.5,3.27614237 10.2761424,3.5 10,3.5 Z M12,3.5 C11.7238576,3.5 11.5,3.27614237 11.5,3 C11.5,2.72385763 11.7238576,2.5 12,2.5 C12.2761424,2.5 12.5,2.72385763 12.5,3 C12.5,3.27614237 12.2761424,3.5 12,3.5 Z M14,3.5 C13.7238576,3.5 13.5,3.27614237 13.5,3 C13.5,2.72385763 13.7238576,2.5 14,2.5 C14.2761424,2.5 14.5,2.72385763 14.5,3 C14.5,3.27614237 14.2761424,3.5 14,3.5 Z M16,3.5 C15.7238576,3.5 15.5,3.27614237 15.5,3 C15.5,2.72385763 15.7238576,2.5 16,2.5 C16.2761424,2.5 16.5,2.72385763 16.5,3 C16.5,3.27614237 16.2761424,3.5 16,3.5 Z M18,3.5 C17.7238576,3.5 17.5,3.27614237 17.5,3 C17.5,2.72385763 17.7238576,2.5 18,2.5 C18.2761424,2.5 18.5,2.72385763 18.5,3 C18.5,3.27614237 18.2761424,3.5 18,3.5 Z M18,5.5 C17.7238576,5.5 17.5,5.27614237 17.5,5 C17.5,4.72385763 17.7238576,4.5 18,4.5 C18.2761424,4.5 18.5,4.72385763 18.5,5 C18.5,Line truncated
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="49px" height="52px" viewBox="-5 0 49 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>play</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M17.2214651,8.34499443 C19.7766419,4.08636653 23.9234057,4.09303946 26.4745787,8.34499443 L40.1520974,31.140859 C42.7072741,35.3994869 40.7489672,38.8517869 35.7726637,38.8517869 L7.92338006,38.8517869 C2.9495089,38.8517869 0.992773429,35.392814 3.54394641,31.140859 L17.2214651,8.34499443 Z" id="path-1"></path>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop---1280x720" transform="translate(-623.000000, -347.000000)">
<g id="Step-3---Altering-Suggested-Trim" transform="translate(0.000000, 42.000000)">
<g id="Play-/-Record-/-Stop" transform="translate(623.000000, 307.000000)">
<g id="play" transform="translate(21.849131, 22.002656) rotate(90.000000) translate(-21.849131, -22.002656) ">
<use stroke="#FFFFFF" stroke-width="1" fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="52px" height="52px" viewBox="0 0 52 52" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>stop-playback</title>
<desc>Created with Sketch.</desc>
<defs>
<rect id="path-1" x="0" y="0" width="44" height="44" rx="4"></rect>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop---1280x720" transform="translate(-619.000000, -345.000000)">
<g id="Step-4---Playing-Trim" transform="translate(0.000000, 42.000000)">
<g id="Play-/-Record-/-Stop" transform="translate(623.000000, 307.000000)">
<g id="stop-playback">
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
<rect stroke="#FFFFFF" stroke-width="1" x="0.5" y="0.5" width="43" height="43" rx="4"></rect>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+28 -8
View File
@@ -63,7 +63,9 @@
background: hsla(300, 53%, 60%, 0.15);
border: 1px solid $ui-black-transparent;
border-radius: 5px;
padding: 3px;
margin-top: 20px;
margin-bottom: 20px;
}
$border-radius: 0.25rem;
@@ -93,9 +95,9 @@ $border-radius: 0.25rem;
height: 3rem;
width: 3rem;
outline: none;
background: white;
background: $motion-primary;
border-radius: 100%;
border: 1px solid $ui-black-transparent;
border: 4px solid $ui-white-dim;
cursor: pointer;
padding: 0.75rem;
user-select: none;
@@ -118,6 +120,7 @@ $border-radius: 0.25rem;
color: $text-primary;
font-size: 0.625rem;
user-select: none;
}
[dir="ltr"] .trim-button {
@@ -130,7 +133,6 @@ $border-radius: 0.25rem;
.trim-button > img {
width: 1.25rem;
margin-bottom: -0.375rem;
}
.effect-button {
@@ -138,6 +140,7 @@ $border-radius: 0.25rem;
color: $text-primary;
font-size: 0.625rem;
user-select: none;
padding: 0.25rem 0;
}
.effect-button + .effect-button {
@@ -150,12 +153,25 @@ $border-radius: 0.25rem;
margin-bottom: -0.375rem;
}
/* mirror the louder/softer speaker icons when rtl */
[dir="rtl"] .effect-button:nth-of-type(6) img {
transform: scaleX(-1);
.tool-button {
flex-basis: 60px;
color: $text-primary;
font-size: 0.625rem;
user-select: none;
padding: 0.25rem 0;
}
[dir="rtl"] .effect-button:nth-of-type(7) img {
.tool-button + .tool-button {
margin: 0;
}
.tool-button img {
width: 4rem;
height: 1.5rem;
margin-bottom: -0.375rem;
}
[dir="rtl"] .flip-in-rtl img {
transform: scaleX(-1);
}
@@ -167,6 +183,10 @@ $border-radius: 0.25rem;
margin-right: 1rem;
}
.button-group {
display: flex;
}
.button-group .button {
border-radius: 0;
}
+117 -41
View File
@@ -8,24 +8,29 @@ import Label from '../forms/label.jsx';
import Input from '../forms/input.jsx';
import BufferedInputHOC from '../forms/buffered-input-hoc.jsx';
import AudioTrimmer from '../../containers/audio-trimmer.jsx';
import AudioSelector from '../../containers/audio-selector.jsx';
import IconButton from '../icon-button/icon-button.jsx';
import styles from './sound-editor.css';
import playIcon from '../record-modal/icon--play.svg';
import stopIcon from '../record-modal/icon--stop-playback.svg';
import trimIcon from './icon--trim.svg';
import trimConfirmIcon from './icon--trim-confirm.svg';
import playIcon from './icon--play.svg';
import stopIcon from './icon--stop.svg';
import redoIcon from './icon--redo.svg';
import undoIcon from './icon--undo.svg';
import echoIcon from './icon--echo.svg';
import fasterIcon from './icon--faster.svg';
import slowerIcon from './icon--slower.svg';
import louderIcon from './icon--louder.svg';
import softerIcon from './icon--softer.svg';
import robotIcon from './icon--robot.svg';
import reverseIcon from './icon--reverse.svg';
import fadeOutIcon from './icon--fade-out.svg';
import fadeInIcon from './icon--fade-in.svg';
import muteIcon from './icon--mute.svg';
import deleteIcon from './icon--delete.svg';
import copyIcon from './icon--copy.svg';
import pasteIcon from './icon--paste.svg';
import copyToNewIcon from './icon--copy-to-new.svg';
const BufferedInput = BufferedInputHOC(Input);
@@ -45,10 +50,25 @@ const messages = defineMessages({
description: 'Title of the button to stop the sound',
defaultMessage: 'Stop'
},
trim: {
id: 'gui.soundEditor.trim',
description: 'Title of the button to start trimminging the sound',
defaultMessage: 'Trim'
copy: {
id: 'gui.soundEditor.copy',
description: 'Title of the button to copy the sound',
defaultMessage: 'Copy'
},
paste: {
id: 'gui.soundEditor.paste',
description: 'Title of the button to paste the sound',
defaultMessage: 'Paste'
},
copyToNew: {
id: 'gui.soundEditor.copyToNew',
description: 'Title of the button to copy the selection into a new sound',
defaultMessage: 'Copy to New'
},
delete: {
id: 'gui.soundEditor.delete',
description: 'Title of the button to delete the sound',
defaultMessage: 'Delete'
},
save: {
id: 'gui.soundEditor.save',
@@ -99,11 +119,30 @@ const messages = defineMessages({
id: 'gui.soundEditor.reverse',
description: 'Title of the button to apply the reverse effect',
defaultMessage: 'Reverse'
},
fadeOut: {
id: 'gui.soundEditor.fadeOut',
description: 'Title of the button to apply the fade out effect',
defaultMessage: 'Fade out'
},
fadeIn: {
id: 'gui.soundEditor.fadeIn',
description: 'Title of the button to apply the fade in effect',
defaultMessage: 'Fade in'
},
mute: {
id: 'gui.soundEditor.mute',
description: 'Title of the button to apply the mute effect',
defaultMessage: 'Mute'
}
});
const SoundEditor = props => (
<div className={styles.editorContainer}>
<div
className={styles.editorContainer}
ref={props.setRef}
onMouseDown={props.onContainerClick}
>
<div className={styles.row}>
<div className={styles.inputGroup}>
<Label text={props.intl.formatMessage(messages.sound)}>
@@ -141,17 +180,33 @@ const SoundEditor = props => (
</button>
</div>
</div>
<div className={styles.inputGroup}>
<IconButton
className={styles.toolButton}
img={copyIcon}
title={props.intl.formatMessage(messages.copy)}
onClick={props.onCopy}
/>
<IconButton
className={styles.toolButton}
disabled={props.canPaste === false}
img={pasteIcon}
title={props.intl.formatMessage(messages.paste)}
onClick={props.onPaste}
/>
<IconButton
className={classNames(styles.toolButton, styles.flipInRtl)}
img={copyToNewIcon}
title={props.intl.formatMessage(messages.copyToNew)}
onClick={props.onCopyToNew}
/>
</div>
<IconButton
className={classNames(styles.trimButton, {
[styles.trimButtonActive]: props.trimStart !== null
})}
img={props.trimStart === null ? trimIcon : trimConfirmIcon}
title={props.trimStart === null ? (
<FormattedMessage {...messages.trim} />
) : (
<FormattedMessage {...messages.save} />
)}
onClick={props.onActivateTrim}
className={styles.toolButton}
disabled={props.trimStart === null}
img={deleteIcon}
title={props.intl.formatMessage(messages.delete)}
onClick={props.onDelete}
/>
</div>
<div className={styles.row}>
@@ -161,12 +216,13 @@ const SoundEditor = props => (
height={160}
width={600}
/>
<AudioTrimmer
<AudioSelector
playhead={props.playhead}
trimEnd={props.trimEnd}
trimStart={props.trimStart}
onSetTrimEnd={props.onSetTrimEnd}
onSetTrimStart={props.onSetTrimStart}
onPlay={props.onPlay}
onSetTrim={props.onSetTrim}
onStop={props.onStop}
/>
</div>
</div>
@@ -209,61 +265,81 @@ const SoundEditor = props => (
onClick={props.onSlower}
/>
<IconButton
className={styles.effectButton}
img={echoIcon}
title={<FormattedMessage {...messages.echo} />}
onClick={props.onEcho}
/>
<IconButton
className={styles.effectButton}
img={robotIcon}
title={<FormattedMessage {...messages.robot} />}
onClick={props.onRobot}
/>
<IconButton
className={styles.effectButton}
className={classNames(styles.effectButton, styles.flipInRtl)}
img={louderIcon}
title={<FormattedMessage {...messages.louder} />}
onClick={props.onLouder}
/>
<IconButton
className={styles.effectButton}
className={classNames(styles.effectButton, styles.flipInRtl)}
img={softerIcon}
title={<FormattedMessage {...messages.softer} />}
onClick={props.onSofter}
/>
<IconButton
className={classNames(styles.effectButton, styles.flipInRtl)}
img={muteIcon}
title={<FormattedMessage {...messages.mute} />}
onClick={props.onMute}
/>
<IconButton
className={styles.effectButton}
img={fadeInIcon}
title={<FormattedMessage {...messages.fadeIn} />}
onClick={props.onFadeIn}
/>
<IconButton
className={styles.effectButton}
img={fadeOutIcon}
title={<FormattedMessage {...messages.fadeOut} />}
onClick={props.onFadeOut}
/>
<IconButton
className={styles.effectButton}
img={reverseIcon}
title={<FormattedMessage {...messages.reverse} />}
onClick={props.onReverse}
/>
<IconButton
className={styles.effectButton}
img={robotIcon}
title={<FormattedMessage {...messages.robot} />}
onClick={props.onRobot}
/>
</div>
</div>
);
SoundEditor.propTypes = {
canPaste: PropTypes.bool.isRequired,
canRedo: PropTypes.bool.isRequired,
canUndo: PropTypes.bool.isRequired,
chunkLevels: PropTypes.arrayOf(PropTypes.number).isRequired,
intl: intlShape,
name: PropTypes.string.isRequired,
onActivateTrim: PropTypes.func,
onChangeName: PropTypes.func.isRequired,
onContainerClick: PropTypes.func.isRequired,
onCopy: PropTypes.func.isRequired,
onCopyToNew: PropTypes.func.isRequired,
onDelete: PropTypes.func,
onEcho: PropTypes.func.isRequired,
onFadeIn: PropTypes.func.isRequired,
onFadeOut: PropTypes.func.isRequired,
onFaster: PropTypes.func.isRequired,
onLouder: PropTypes.func.isRequired,
onMute: PropTypes.func.isRequired,
onPaste: PropTypes.func.isRequired,
onPlay: PropTypes.func.isRequired,
onRedo: PropTypes.func.isRequired,
onReverse: PropTypes.func.isRequired,
onRobot: PropTypes.func.isRequired,
onSetTrimEnd: PropTypes.func,
onSetTrimStart: PropTypes.func,
onSetTrim: PropTypes.func,
onSlower: PropTypes.func.isRequired,
onSofter: PropTypes.func.isRequired,
onStop: PropTypes.func.isRequired,
onUndo: PropTypes.func.isRequired,
playhead: PropTypes.number,
setRef: PropTypes.func,
trimEnd: PropTypes.number,
trimStart: PropTypes.number
};
+17
View File
@@ -39,6 +39,16 @@
height: .5rem;
}
.large {
width: 2.5rem;
height: 2.5rem;
}
.large::before, .large::after {
width: 2.5rem;
height: 2.5rem;
}
@keyframes spin {
0% {
transform: rotate(0deg);
@@ -71,3 +81,10 @@
.spinner.info::after {
border-top-color: $ui-white;
}
.spinner.primary {
border-color: $motion-transparent;
}
.spinner.primary::after {
border-top-color: $motion-primary;
}
+10 -3
View File
@@ -8,7 +8,8 @@ const SpinnerComponent = function (props) {
const {
className,
level,
small
small,
large
} = props;
return (
<div
@@ -16,18 +17,24 @@ const SpinnerComponent = function (props) {
className,
styles.spinner,
styles[level],
{[styles.small]: small}
{
[styles.small]: small,
[styles.large]: large
}
)}
/>
);
};
SpinnerComponent.propTypes = {
className: PropTypes.string,
large: PropTypes.bool,
level: PropTypes.string,
small: PropTypes.bool
};
SpinnerComponent.defaultProps = {
className: '',
level: 'info'
large: false,
level: 'info',
small: false
};
export default SpinnerComponent;
@@ -20,7 +20,6 @@
cursor: pointer;
user-select: none;
touch-action: none;
}
.sprite-selector-item.is-selected {
@@ -95,16 +94,16 @@
.delete-button {
position: absolute;
top: 0.125rem;
top: -.625rem;
z-index: auto;
}
[dir="ltr"] .delete-button {
right: 0.125rem;
right: -.625rem;
}
[dir="rtl"] .delete-button {
left: 0.125rem;
left: -.625rem;
}
.number {
@@ -2,7 +2,7 @@ import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import CloseButton from '../close-button/close-button.jsx';
import DeleteButton from '../delete-button/delete-button.jsx';
import styles from './sprite-selector-item.css';
import {ContextMenuTrigger} from 'react-contextmenu';
import {DangerousMenuItem, ContextMenu, MenuItem} from '../context-menu/context-menu.jsx';
@@ -23,8 +23,9 @@ const SpriteSelectorItem = props => (
onMouseDown: props.onMouseDown,
onTouchStart: props.onMouseDown
}}
disable={props.dragging}
disable={props.preventContextMenu}
id={`${props.name}-${contextMenuId}`}
ref={props.componentRef}
>
{typeof props.number === 'undefined' ? null : (
<div className={styles.number}>{props.number}</div>
@@ -47,9 +48,8 @@ const SpriteSelectorItem = props => (
) : null}
</div>
{(props.selected && props.onDeleteButtonClick) ? (
<CloseButton
<DeleteButton
className={styles.deleteButton}
size={CloseButton.SIZE_SMALL}
onClick={props.onDeleteButtonClick}
/>
) : null }
@@ -89,9 +89,9 @@ const SpriteSelectorItem = props => (
SpriteSelectorItem.propTypes = {
className: PropTypes.string,
componentRef: PropTypes.func,
costumeURL: PropTypes.string,
details: PropTypes.string,
dragging: PropTypes.bool,
name: PropTypes.string.isRequired,
number: PropTypes.number,
onClick: PropTypes.func,
@@ -101,6 +101,7 @@ SpriteSelectorItem.propTypes = {
onMouseDown: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
preventContextMenu: PropTypes.bool,
selected: PropTypes.bool.isRequired
};
@@ -110,7 +110,8 @@ SpriteList.propTypes = {
editingTarget: PropTypes.string,
hoveredTarget: PropTypes.shape({
hoveredSprite: PropTypes.string,
receivedBlocks: PropTypes.bool
receivedBlocks: PropTypes.bool,
sprite: PropTypes.string
}),
items: PropTypes.arrayOf(PropTypes.shape({
costume: PropTypes.shape({
@@ -68,6 +68,8 @@
padding-left: calc($space / 2);
padding-right: calc($space / 2);
padding-bottom: $space;
overflow-x: hidden;
}
.add-button {
+11 -14
View File
@@ -19,17 +19,21 @@ class Waveform extends React.PureComponent {
// composite time when animating the playhead
const takeEveryN = Math.ceil(data.length / width);
const filteredData = takeEveryN === 1 ? data :
const filteredData = takeEveryN === 1 ? data.slice(0) :
data.filter((_, i) => i % takeEveryN === 0);
const cappedData = [0, ...filteredData, 0];
// Need at least two points to render waveform.
if (filteredData.length === 1) {
filteredData.push(filteredData[0]);
}
const maxIndex = filteredData.length - 1;
const points = [
...cappedData.map((v, i) =>
[width * i / cappedData.length, height * v / 2]
...filteredData.map((v, i) =>
[width * (i / maxIndex), height * v / 2]
),
...cappedData.reverse().map((v, i) =>
[width * (cappedData.length - i - 1) / cappedData.length, -height * v / 2]
...filteredData.reverse().map((v, i) =>
[width * (1 - (i / maxIndex)), -height * v / 2]
)
];
const pathComponents = points.map(([x, y], i) => {
@@ -40,15 +44,8 @@ class Waveform extends React.PureComponent {
return (
<svg
className={styles.container}
viewBox={`-1 0 ${width} ${height}`}
viewBox={`0 0 ${width} ${height}`}
>
<line
className={styles.baseline}
x1={-1}
x2={width}
y1={height / 2}
y2={height / 2}
/>
<g transform={`scale(1, -1) translate(0, -${height / 2})`}>
<path
className={styles.waveformPath}
+156
View File
@@ -0,0 +1,156 @@
import React from 'react';
import PropTypes from 'prop-types';
import bindAll from 'lodash.bindall';
import AudioSelectorComponent from '../components/audio-trimmer/audio-selector.jsx';
import {getEventXY} from '../lib/touch-utils';
import DragRecognizer from '../lib/drag-recognizer';
const MIN_LENGTH = 0.01;
const MIN_DURATION = 500;
class AudioSelector extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleNewSelectionMouseDown',
'handleTrimStartMouseDown',
'handleTrimEndMouseDown',
'handleTrimStartMouseMove',
'handleTrimEndMouseMove',
'handleTrimStartMouseUp',
'handleTrimEndMouseUp',
'storeRef'
]);
this.state = {
trimStart: props.trimStart,
trimEnd: props.trimEnd
};
this.clickStartTime = 0;
this.trimStartDragRecognizer = new DragRecognizer({
onDrag: this.handleTrimStartMouseMove,
onDragEnd: this.handleTrimStartMouseUp,
touchDragAngle: 90,
distanceThreshold: 0
});
this.trimEndDragRecognizer = new DragRecognizer({
onDrag: this.handleTrimEndMouseMove,
onDragEnd: this.handleTrimEndMouseUp,
touchDragAngle: 90,
distanceThreshold: 0
});
}
componentWillReceiveProps (newProps) {
const {trimStart, trimEnd} = this.props;
if (newProps.trimStart === trimStart && newProps.trimEnd === trimEnd) return;
this.setState({
trimStart: newProps.trimStart,
trimEnd: newProps.trimEnd
});
}
clearSelection () {
this.props.onSetTrim(null, null);
}
handleNewSelectionMouseDown (e) {
const {width, left} = this.containerElement.getBoundingClientRect();
this.initialTrimEnd = (getEventXY(e).x - left) / width;
this.initialTrimStart = this.initialTrimEnd;
this.props.onSetTrim(this.initialTrimStart, this.initialTrimEnd);
this.clickStartTime = Date.now();
this.containerSize = width;
this.trimEndDragRecognizer.start(e);
e.preventDefault();
}
handleTrimStartMouseMove (currentOffset, initialOffset) {
const dx = (currentOffset.x - initialOffset.x) / this.containerSize;
const newTrim = Math.max(0, Math.min(1, this.initialTrimStart + dx));
if (newTrim > this.initialTrimEnd) {
this.setState({
trimStart: this.initialTrimEnd,
trimEnd: newTrim
});
} else {
this.setState({
trimStart: newTrim,
trimEnd: this.initialTrimEnd
});
}
}
handleTrimEndMouseMove (currentOffset, initialOffset) {
const dx = (currentOffset.x - initialOffset.x) / this.containerSize;
const newTrim = Math.min(1, Math.max(0, this.initialTrimEnd + dx));
if (newTrim < this.initialTrimStart) {
this.setState({
trimStart: newTrim,
trimEnd: this.initialTrimStart
});
} else {
this.setState({
trimStart: this.initialTrimStart,
trimEnd: newTrim
});
}
}
handleTrimStartMouseUp () {
this.props.onSetTrim(this.state.trimStart, this.state.trimEnd);
}
handleTrimEndMouseUp () {
// If the selection was made quickly (tooFast) and is small (tooShort),
// deselect instead. This allows click-to-deselect even if you drag
// a little bit by accident. It also allows very quickly making a
// selection, as long as it is above a minimum length.
const tooFast = (Date.now() - this.clickStartTime) < MIN_DURATION;
const tooShort = (this.state.trimEnd - this.state.trimStart) < MIN_LENGTH;
if (tooFast && tooShort) {
this.clearSelection();
} else {
this.props.onSetTrim(this.state.trimStart, this.state.trimEnd);
}
}
handleTrimStartMouseDown (e) {
this.containerSize = this.containerElement.getBoundingClientRect().width;
this.trimStartDragRecognizer.start(e);
this.initialTrimStart = this.props.trimStart;
this.initialTrimEnd = this.props.trimEnd;
e.stopPropagation();
e.preventDefault();
}
handleTrimEndMouseDown (e) {
this.containerSize = this.containerElement.getBoundingClientRect().width;
this.trimEndDragRecognizer.start(e);
this.initialTrimEnd = this.props.trimEnd;
this.initialTrimStart = this.props.trimStart;
e.stopPropagation();
e.preventDefault();
}
storeRef (el) {
this.containerElement = el;
}
render () {
return (
<AudioSelectorComponent
containerRef={this.storeRef}
playhead={this.props.playhead}
trimEnd={this.state.trimEnd}
trimStart={this.state.trimStart}
onNewSelectionMouseDown={this.handleNewSelectionMouseDown}
onTrimEndMouseDown={this.handleTrimEndMouseDown}
onTrimStartMouseDown={this.handleTrimStartMouseDown}
/>
);
}
}
AudioSelector.propTypes = {
onSetTrim: PropTypes.func,
playhead: PropTypes.number,
trimEnd: PropTypes.number,
trimStart: PropTypes.number
};
export default AudioSelector;
+24 -33
View File
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import bindAll from 'lodash.bindall';
import AudioTrimmerComponent from '../components/audio-trimmer/audio-trimmer.jsx';
import {getEventXY} from '../lib/touch-utils';
import DragRecognizer from '../lib/drag-recognizer';
const MIN_LENGTH = 0.01; // Used to stop sounds being trimmed smaller than 1%
@@ -14,52 +14,43 @@ class AudioTrimmer extends React.Component {
'handleTrimEndMouseDown',
'handleTrimStartMouseMove',
'handleTrimEndMouseMove',
'handleTrimStartMouseUp',
'handleTrimEndMouseUp',
'storeRef'
]);
this.trimStartDragRecognizer = new DragRecognizer({
onDrag: this.handleTrimStartMouseMove,
touchDragAngle: 90,
distanceThreshold: 0
});
this.trimEndDragRecognizer = new DragRecognizer({
onDrag: this.handleTrimEndMouseMove,
touchDragAngle: 90,
distanceThreshold: 0
});
}
handleTrimStartMouseMove (e) {
const containerSize = this.containerElement.getBoundingClientRect().width;
const dx = (getEventXY(e).x - this.initialX) / containerSize;
handleTrimStartMouseMove (currentOffset, initialOffset) {
const dx = (currentOffset.x - initialOffset.x) / this.containerSize;
const newTrim = Math.max(0, Math.min(this.props.trimEnd - MIN_LENGTH, this.initialTrim + dx));
this.props.onSetTrimStart(newTrim);
e.preventDefault();
}
handleTrimEndMouseMove (e) {
const containerSize = this.containerElement.getBoundingClientRect().width;
const dx = (getEventXY(e).x - this.initialX) / containerSize;
handleTrimEndMouseMove (currentOffset, initialOffset) {
const dx = (currentOffset.x - initialOffset.x) / this.containerSize;
const newTrim = Math.min(1, Math.max(this.props.trimStart + MIN_LENGTH, this.initialTrim + dx));
this.props.onSetTrimEnd(newTrim);
e.preventDefault();
}
handleTrimStartMouseUp () {
window.removeEventListener('mousemove', this.handleTrimStartMouseMove);
window.removeEventListener('mouseup', this.handleTrimStartMouseUp);
window.removeEventListener('touchmove', this.handleTrimStartMouseMove);
window.removeEventListener('touchend', this.handleTrimStartMouseUp);
}
handleTrimEndMouseUp () {
window.removeEventListener('mousemove', this.handleTrimEndMouseMove);
window.removeEventListener('mouseup', this.handleTrimEndMouseUp);
window.removeEventListener('touchmove', this.handleTrimEndMouseMove);
window.removeEventListener('touchend', this.handleTrimEndMouseUp);
}
handleTrimStartMouseDown (e) {
this.initialX = getEventXY(e).x;
this.containerSize = this.containerElement.getBoundingClientRect().width;
this.trimStartDragRecognizer.start(e);
this.initialTrim = this.props.trimStart;
window.addEventListener('mousemove', this.handleTrimStartMouseMove);
window.addEventListener('mouseup', this.handleTrimStartMouseUp);
window.addEventListener('touchmove', this.handleTrimStartMouseMove);
window.addEventListener('touchend', this.handleTrimStartMouseUp);
e.stopPropagation();
e.preventDefault();
}
handleTrimEndMouseDown (e) {
this.initialX = getEventXY(e).x;
this.containerSize = this.containerElement.getBoundingClientRect().width;
this.trimEndDragRecognizer.start(e);
this.initialTrim = this.props.trimEnd;
window.addEventListener('mousemove', this.handleTrimEndMouseMove);
window.addEventListener('mouseup', this.handleTrimEndMouseUp);
window.addEventListener('touchmove', this.handleTrimEndMouseMove);
window.addEventListener('touchend', this.handleTrimEndMouseUp);
e.stopPropagation();
e.preventDefault();
}
storeRef (el) {
this.containerElement = el;
+2 -2
View File
@@ -67,7 +67,7 @@ class AutoScanningStep extends React.Component {
render () {
return (
<ScanningStepComponent
peripheralButtonImage={this.props.peripheralButtonImage}
connectionTipIconURL={this.props.connectionTipIconURL}
phase={this.state.phase}
title={this.props.extensionId}
onRefresh={this.handleRefresh}
@@ -78,9 +78,9 @@ class AutoScanningStep extends React.Component {
}
AutoScanningStep.propTypes = {
connectionTipIconURL: PropTypes.string,
extensionId: PropTypes.string.isRequired,
onConnecting: PropTypes.func.isRequired,
peripheralButtonImage: PropTypes.string,
vm: PropTypes.instanceOf(VM).isRequired
};
+2 -13
View File
@@ -2,7 +2,6 @@ import bindAll from 'lodash.bindall';
import PropTypes from 'prop-types';
import React from 'react';
import {defineMessages, injectIntl, intlShape} from 'react-intl';
import {connect} from 'react-redux';
import VM from 'scratch-vm';
import backdropLibraryContent from '../lib/libraries/backdrops.json';
@@ -33,7 +32,7 @@ class BackdropLibrary extends React.Component {
bitmapResolution: item.info.length > 2 ? item.info[2] : 1,
skinId: null
};
this.props.vm.setEditingTarget(this.props.stageID);
// Do not switch to stage, just add the backdrop
this.props.vm.addBackdrop(item.md5, vmBackdrop);
}
render () {
@@ -53,17 +52,7 @@ class BackdropLibrary extends React.Component {
BackdropLibrary.propTypes = {
intl: intlShape.isRequired,
onRequestClose: PropTypes.func,
stageID: PropTypes.string.isRequired,
vm: PropTypes.instanceOf(VM).isRequired
};
const mapStateToProps = state => ({
stageID: state.scratchGui.targets.stage.id
});
const mapDispatchToProps = () => ({});
export default injectIntl(connect(
mapStateToProps,
mapDispatchToProps
)(BackdropLibrary));
export default injectIntl(BackdropLibrary);
+16
View File
@@ -83,12 +83,15 @@ class Backpack extends React.Component {
}
handleDrop (dragInfo) {
let payloader = null;
let presaveAsset = null;
switch (dragInfo.dragType) {
case DragConstants.COSTUME:
payloader = costumePayload;
presaveAsset = dragInfo.payload.asset;
break;
case DragConstants.SOUND:
payloader = soundPayload;
presaveAsset = dragInfo.payload.asset;
break;
case DragConstants.SPRITE:
payloader = spritePayload;
@@ -102,6 +105,19 @@ class Backpack extends React.Component {
// Creating the payload is async, so set loading before starting
this.setState({loading: true}, () => {
payloader(dragInfo.payload, this.props.vm)
.then(payload => {
// Force the asset to save to the asset server before storing in backpack
// Ensures any asset present in the backpack is also on the asset server
if (presaveAsset && !presaveAsset.clean) {
return storage.store(
presaveAsset.assetType,
presaveAsset.dataFormat,
presaveAsset.data,
presaveAsset.assetId
).then(() => payload);
}
return payload;
})
.then(payload => saveBackpackObject({
host: this.props.host,
token: this.props.token,
+53 -7
View File
@@ -17,6 +17,7 @@ import errorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
import {STAGE_DISPLAY_SIZES} from '../lib/layout-constants';
import DropAreaHOC from '../lib/drop-area-hoc.jsx';
import DragConstants from '../lib/drag-constants';
import defineDynamicBlock from '../lib/define-dynamic-block';
import {connect} from 'react-redux';
import {updateToolbox} from '../reducers/toolbox';
@@ -96,6 +97,21 @@ class Blocks extends React.Component {
);
this.workspace = this.ScratchBlocks.inject(this.blocks, workspaceConfig);
// Register buttons under new callback keys for creating variables,
// lists, and procedures from extensions.
const toolboxWorkspace = this.workspace.getFlyout().getWorkspace();
const varListButtonCallback = type =>
(() => this.ScratchBlocks.Variables.createVariable(this.workspace, null, type));
const procButtonCallback = () => {
this.ScratchBlocks.Procedures.createProcedureDefCallback_(this.workspace);
};
toolboxWorkspace.registerButtonCallback('MAKE_A_VARIABLE', varListButtonCallback(''));
toolboxWorkspace.registerButtonCallback('MAKE_A_LIST', varListButtonCallback('list'));
toolboxWorkspace.registerButtonCallback('MAKE_A_PROCEDURE', procButtonCallback);
// Store the xml of the toolbox that is actually rendered.
// This is used in componentDidUpdate instead of prevProps, because
// the xml can change while e.g. on the costumes tab.
@@ -378,20 +394,50 @@ class Blocks extends React.Component {
// workspace to be 'undone' here.
this.workspace.clearUndo();
}
handleExtensionAdded (blocksInfo) {
// select JSON from each block info object then reject the pseudo-blocks which don't have JSON, like separators
// this actually defines blocks and MUST run regardless of the UI state
this.ScratchBlocks.defineBlocksWithJsonArray(blocksInfo.map(blockInfo => blockInfo.json).filter(x => x));
handleExtensionAdded (categoryInfo) {
const defineBlocks = blockInfoArray => {
if (blockInfoArray && blockInfoArray.length > 0) {
const staticBlocksJson = [];
const dynamicBlocksInfo = [];
blockInfoArray.forEach(blockInfo => {
if (blockInfo.info && blockInfo.info.isDynamic) {
dynamicBlocksInfo.push(blockInfo);
} else if (blockInfo.json) {
staticBlocksJson.push(blockInfo.json);
}
// otherwise it's a non-block entry such as '---'
});
// Update the toolbox with new blocks
this.ScratchBlocks.defineBlocksWithJsonArray(staticBlocksJson);
dynamicBlocksInfo.forEach(blockInfo => {
// This is creating the block factory / constructor -- NOT a specific instance of the block.
// The factory should only know static info about the block: the category info and the opcode.
// Anything else will be picked up from the XML attached to the block instance.
const extendedOpcode = `${categoryInfo.id}_${blockInfo.info.opcode}`;
const blockDefinition =
defineDynamicBlock(this.ScratchBlocks, categoryInfo, blockInfo, extendedOpcode);
this.ScratchBlocks.Blocks[extendedOpcode] = blockDefinition;
});
}
};
// scratch-blocks implements a menu or custom field as a special kind of block ("shadow" block)
// these actually define blocks and MUST run regardless of the UI state
defineBlocks(
Object.getOwnPropertyNames(categoryInfo.customFieldTypes)
.map(fieldTypeName => categoryInfo.customFieldTypes[fieldTypeName].scratchBlocksDefinition));
defineBlocks(categoryInfo.menus);
defineBlocks(categoryInfo.blocks);
// Update the toolbox with new blocks if possible
const toolboxXML = this.getToolboxXML();
if (toolboxXML) {
this.props.updateToolboxState(toolboxXML);
}
}
handleBlocksInfoUpdate (blocksInfo) {
handleBlocksInfoUpdate (categoryInfo) {
// @todo Later we should replace this to avoid all the warnings from redefining blocks.
this.handleExtensionAdded(blocksInfo);
this.handleExtensionAdded(categoryInfo);
}
handleCategorySelected (categoryId) {
const extension = extensionData.find(ext => ext.extensionId === categoryId);
+6 -1
View File
@@ -5,6 +5,7 @@ import React from 'react';
import {
activateDeck,
closeCards,
shrinkExpandCards,
nextStep,
prevStep,
dragCard,
@@ -18,6 +19,7 @@ import {
import CardsComponent from '../components/cards/cards.jsx';
import {loadImageData} from '../lib/libraries/decks/translate-image.js';
import {notScratchDesktop} from '../lib/isScratchDesktop';
class Cards extends React.Component {
componentDidMount () {
@@ -46,11 +48,13 @@ const mapStateToProps = state => ({
content: state.scratchGui.cards.content,
activeDeckId: state.scratchGui.cards.activeDeckId,
step: state.scratchGui.cards.step,
expanded: state.scratchGui.cards.expanded,
x: state.scratchGui.cards.x,
y: state.scratchGui.cards.y,
isRtl: state.locales.isRtl,
locale: state.locales.locale,
dragging: state.scratchGui.cards.dragging
dragging: state.scratchGui.cards.dragging,
showVideos: notScratchDesktop()
});
const mapDispatchToProps = dispatch => ({
@@ -60,6 +64,7 @@ const mapDispatchToProps = dispatch => ({
dispatch(closeCards());
},
onCloseCards: () => dispatch(closeCards()),
onShrinkExpandCards: () => dispatch(shrinkExpandCards()),
onNextStep: () => dispatch(nextStep()),
onPrevStep: () => dispatch(prevStep()),
onDrag: (e_, data) => dispatch(dragCard(data.x, data.y)),
+6 -6
View File
@@ -107,15 +107,15 @@ class ConnectionModal extends React.Component {
render () {
return (
<ConnectionModalComponent
connectingMessage={this.state.extension.connectingMessage}
connectingMessage={this.state.extension && this.state.extension.connectingMessage}
connectionIconURL={this.state.extension && this.state.extension.connectionIconURL}
connectionSmallIconURL={this.state.extension && this.state.extension.connectionSmallIconURL}
connectionTipIconURL={this.state.extension && this.state.extension.connectionTipIconURL}
extensionId={this.props.extensionId}
name={this.state.extension.name}
peripheralButtonImage={this.state.extension.peripheralButtonImage}
peripheralImage={this.state.extension.peripheralImage}
name={this.state.extension && this.state.extension.name}
phase={this.state.phase}
smallPeripheralImage={this.state.extension.smallPeripheralImage}
title={this.props.extensionId}
useAutoScan={this.state.extension.useAutoScan}
useAutoScan={this.state.extension && this.state.extension.useAutoScan}
vm={this.props.vm}
onCancel={this.handleCancel}
onConnected={this.handleConnected}
+5 -1
View File
@@ -52,6 +52,7 @@ class GUI extends React.Component {
setIsScratchDesktop(this.props.isScratchDesktop);
this.setReduxTitle(this.props.projectTitle);
this.props.onStorageInit(storage);
this.props.onVmInit(this.props.vm);
}
componentDidUpdate (prevProps) {
if (this.props.projectId !== prevProps.projectId && this.props.projectId !== null) {
@@ -92,6 +93,7 @@ class GUI extends React.Component {
onStorageInit,
onUpdateProjectId,
onUpdateReduxProjectTitle,
onVmInit,
projectHost,
projectId,
projectTitle,
@@ -131,6 +133,7 @@ GUI.propTypes = {
onUpdateProjectId: PropTypes.func,
onUpdateProjectTitle: PropTypes.func,
onUpdateReduxProjectTitle: PropTypes.func,
onVmInit: PropTypes.func,
projectHost: PropTypes.string,
projectId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
projectTitle: PropTypes.string,
@@ -142,7 +145,8 @@ GUI.defaultProps = {
isScratchDesktop: false,
onStorageInit: storageInstance => storageInstance.addOfficialScratchWebStores(),
onProjectLoaded: () => {},
onUpdateProjectId: () => {}
onUpdateProjectId: () => {},
onVmInit: (/* vm */) => {}
};
const mapStateToProps = state => {
+43 -31
View File
@@ -15,6 +15,8 @@ class LibraryItem extends React.PureComponent {
'handleKeyPress',
'handleMouseEnter',
'handleMouseLeave',
'handlePlay',
'handleStop',
'rotateIcon',
'startRotatingIcons',
'stopRotatingIcons'
@@ -37,7 +39,9 @@ class LibraryItem extends React.PureComponent {
e.preventDefault();
}
handleFocus (id) {
this.handleMouseEnter(id);
if (!this.props.showPlayButton) {
this.handleMouseEnter(id);
}
}
handleKeyPress (e) {
if (e.key === ' ' || e.key === 'Enter') {
@@ -46,22 +50,34 @@ class LibraryItem extends React.PureComponent {
}
}
handleMouseEnter () {
this.props.onMouseEnter(this.props.id);
if (this.props.icons && this.props.icons.length) {
this.stopRotatingIcons();
this.setState({
isRotatingIcon: true
}, this.startRotatingIcons);
// only show hover effects on the item if not showing a play button
if (!this.props.showPlayButton) {
this.props.onMouseEnter(this.props.id);
if (this.props.icons && this.props.icons.length) {
this.stopRotatingIcons();
this.setState({
isRotatingIcon: true
}, this.startRotatingIcons);
}
}
}
handleMouseLeave () {
this.props.onMouseLeave(this.props.id);
if (this.props.icons && this.props.icons.length) {
this.setState({
isRotatingIcon: false
}, this.stopRotatingIcons);
// only show hover effects on the item if not showing a play button
if (!this.props.showPlayButton) {
this.props.onMouseLeave(this.props.id);
if (this.props.icons && this.props.icons.length) {
this.setState({
isRotatingIcon: false
}, this.stopRotatingIcons);
}
}
}
handlePlay () {
this.props.onMouseEnter(this.props.id);
}
handleStop () {
this.props.onMouseLeave(this.props.id);
}
startRotatingIcons () {
this.rotateIcon();
this.intervalId = setInterval(this.rotateIcon, 300);
@@ -75,21 +91,17 @@ class LibraryItem extends React.PureComponent {
const nextIconIndex = (this.state.iconIndex + 1) % this.props.icons.length;
this.setState({iconIndex: nextIconIndex});
}
curIconMd5 () {
curIconSource () {
if (this.props.icons &&
this.state.isRotatingIcon &&
this.state.iconIndex < this.props.icons.length &&
this.props.icons[this.state.iconIndex] &&
this.props.icons[this.state.iconIndex].baseLayerMD5) {
return this.props.icons[this.state.iconIndex].baseLayerMD5;
this.props.icons[this.state.iconIndex]) {
return this.props.icons[this.state.iconIndex];
}
return this.props.iconMd5;
return this.props.iconSource;
}
render () {
const iconMd5 = this.curIconMd5();
const iconURL = iconMd5 ?
`https://cdn.assets.scratch.mit.edu/internalapi/asset/${iconMd5}/get/` :
this.props.iconRawURL;
const iconSource = this.curIconSource();
return (
<LibraryItemComponent
bluetoothRequired={this.props.bluetoothRequired}
@@ -99,18 +111,21 @@ class LibraryItem extends React.PureComponent {
extensionId={this.props.extensionId}
featured={this.props.featured}
hidden={this.props.hidden}
iconURL={iconURL}
icons={this.props.icons}
iconSource={iconSource}
id={this.props.id}
insetIconURL={this.props.insetIconURL}
internetConnectionRequired={this.props.internetConnectionRequired}
isPlaying={this.props.isPlaying}
name={this.props.name}
showPlayButton={this.props.showPlayButton}
onBlur={this.handleBlur}
onClick={this.handleClick}
onFocus={this.handleFocus}
onKeyPress={this.handleKeyPress}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onPlay={this.handlePlay}
onStop={this.handleStop}
/>
);
}
@@ -127,23 +142,20 @@ LibraryItem.propTypes = {
extensionId: PropTypes.string,
featured: PropTypes.bool,
hidden: PropTypes.bool,
iconMd5: PropTypes.string,
iconRawURL: PropTypes.string,
icons: PropTypes.arrayOf(
PropTypes.shape({
baseLayerMD5: PropTypes.string
})
),
iconSource: LibraryItemComponent.propTypes.iconSource, // single icon
icons: PropTypes.arrayOf(LibraryItemComponent.propTypes.iconSource), // rotating icons
id: PropTypes.number.isRequired,
insetIconURL: PropTypes.string,
internetConnectionRequired: PropTypes.bool,
isPlaying: PropTypes.bool,
name: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node
]),
onMouseEnter: PropTypes.func.isRequired,
onMouseLeave: PropTypes.func.isRequired,
onSelect: PropTypes.func.isRequired
onSelect: PropTypes.func.isRequired,
showPlayButton: PropTypes.bool
};
export default injectIntl(LibraryItem);
+66
View File
@@ -0,0 +1,66 @@
import {connect} from 'react-redux';
import PropTypes from 'prop-types';
import bindAll from 'lodash.bindall';
import React from 'react';
const MenuBarHOC = function (WrappedComponent) {
class MenuBarContainer extends React.PureComponent {
constructor (props) {
super(props);
bindAll(this, [
'confirmReadyToReplaceProject',
'shouldSaveBeforeTransition'
]);
}
confirmReadyToReplaceProject (message) {
let readyToReplaceProject = true;
if (this.props.projectChanged && !this.props.canCreateNew) {
readyToReplaceProject = this.props.confirmWithMessage(message);
}
return readyToReplaceProject;
}
shouldSaveBeforeTransition () {
return (this.props.canSave && this.props.projectChanged);
}
render () {
const {
/* eslint-disable no-unused-vars */
projectChanged,
/* eslint-enable no-unused-vars */
...props
} = this.props;
return (<WrappedComponent
confirmReadyToReplaceProject={this.confirmReadyToReplaceProject}
shouldSaveBeforeTransition={this.shouldSaveBeforeTransition}
{...props}
/>);
}
}
MenuBarContainer.propTypes = {
canCreateNew: PropTypes.bool,
canSave: PropTypes.bool,
confirmWithMessage: PropTypes.func,
projectChanged: PropTypes.bool
};
MenuBarContainer.defaultProps = {
// default to using standard js confirm
confirmWithMessage: message => (confirm(message)) // eslint-disable-line no-alert
};
const mapStateToProps = state => ({
projectChanged: state.scratchGui.projectChanged
});
const mapDispatchToProps = () => ({});
// Allow incoming props to override redux-provided props. Used to mock in tests.
const mergeProps = (stateProps, dispatchProps, ownProps) => Object.assign(
{}, stateProps, dispatchProps, ownProps
);
return connect(
mapStateToProps,
mapDispatchToProps,
mergeProps
)(MenuBarContainer);
};
export default MenuBarHOC;
+115
View File
@@ -0,0 +1,115 @@
import PropTypes from 'prop-types';
import React from 'react';
import bindAll from 'lodash.bindall';
import PlayButtonComponent from '../components/play-button/play-button.jsx';
class PlayButton extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleClick',
'handleMouseDown',
'handleMouseEnter',
'handleMouseLeave',
'handleTouchStart',
'setButtonRef'
]);
this.state = {
touchStarted: false
};
}
getDerivedStateFromProps (props, state) {
// if touchStarted is true and it's not playing, the sound must have ended.
// reset the touchStarted state to allow the sound to be replayed
if (state.touchStarted && !props.isPlaying) {
return {
touchStarted: false
};
}
return null; // nothing changed
}
componentDidMount () {
// Touch start
this.buttonRef.addEventListener('touchstart', this.handleTouchStart);
}
componentWillUnmount () {
this.buttonRef.removeEventListener('touchstart', this.handleTouchStart);
}
handleClick (e) {
// stop the click from propagating out of the button
e.stopPropagation();
}
handleMouseDown (e) {
// prevent default (focus) on mouseDown
e.preventDefault();
if (this.props.isPlaying) {
// stop sound and reset touch state
this.props.onStop();
if (this.state.touchstarted) this.setState({touchStarted: false});
} else {
this.props.onPlay();
if (this.state.touchstarted) {
// started on touch, but now clicked mouse
this.setState({touchStarted: false});
}
}
}
handleTouchStart (e) {
if (this.props.isPlaying) {
// If playing, stop sound, and reset touch state
e.preventDefault();
this.setState({touchStarted: false});
this.props.onStop();
} else {
// otherwise start playing, and set touch state
e.preventDefault();
this.setState({touchStarted: true});
this.props.onPlay();
}
}
handleMouseEnter (e) {
// start the sound if it's not already playing
e.preventDefault();
if (!this.props.isPlaying) {
this.props.onPlay();
}
}
handleMouseLeave () {
// stop the sound unless it was started by touch
if (this.props.isPlaying && !this.state.touchstarted) {
this.props.onStop();
}
}
setButtonRef (ref) {
this.buttonRef = ref;
}
render () {
const {
className,
isPlaying,
onPlay, // eslint-disable-line no-unused-vars
onStop // eslint-disable-line no-unused-vars
} = this.props;
return (
<PlayButtonComponent
className={className}
isPlaying={isPlaying}
onClick={this.handleClick}
onMouseDown={this.handleMouseDown}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
setButtonRef={this.setButtonRef}
/>
);
}
}
PlayButton.propTypes = {
className: PropTypes.string,
isPlaying: PropTypes.bool.isRequired,
onPlay: PropTypes.func.isRequired,
onStop: PropTypes.func.isRequired
};
export default PlayButton;
+3 -30
View File
@@ -2,8 +2,8 @@ import bindAll from 'lodash.bindall';
import PropTypes from 'prop-types';
import React from 'react';
import VM from 'scratch-vm';
import WavEncoder from 'wav-encoder';
import {connect} from 'react-redux';
import {encodeAndAddSoundToVM} from '../lib/audio/audio-util.js';
import RecordModalComponent from '../components/record-modal/record-modal.jsx';
@@ -71,39 +71,12 @@ class RecordModal extends React.Component {
const startIndex = Math.floor(this.state.trimStart * sampleCount);
const endIndex = Math.floor(this.state.trimEnd * sampleCount);
const clippedSamples = this.state.samples.slice(startIndex, endIndex);
WavEncoder.encode({
sampleRate: this.state.sampleRate,
channelData: [clippedSamples]
}).then(wavBuffer => {
const vmSound = {
format: '',
dataFormat: 'wav',
rate: this.state.sampleRate,
sampleCount: clippedSamples.length
};
// Create an asset from the encoded .wav and get resulting md5
const storage = this.props.vm.runtime.storage;
vmSound.asset = storage.createAsset(
storage.AssetType.Sound,
storage.DataFormat.WAV,
new Uint8Array(wavBuffer),
null,
true // generate md5
);
vmSound.assetId = vmSound.asset.assetId;
// update vmSound object with md5 property
vmSound.md5 = `${vmSound.assetId}.${vmSound.dataFormat}`;
// The VM will update the sound name to a fresh name
// if the following is already taken
vmSound.name = 'recording1';
this.props.vm.addSound(vmSound).then(() => {
encodeAndAddSoundToVM(this.props.vm, clippedSamples, this.state.sampleRate, 'recording1',
() => {
this.props.onClose();
this.props.onNewSound();
});
});
});
}
handleCancel () {
+23 -18
View File
@@ -26,13 +26,14 @@ import {
/**
* SBFileUploader component passes a file input, load handler and props to its child.
* It expects this child to be a function with the signature
* function (renderFileInput, loadProject) {}
* function (renderFileInput, handleLoadProject) {}
* The component can then be used to attach project loading functionality
* to any other component:
*
* <SBFileUploader>{(renderFileInput, loadProject) => (
* <SBFileUploader>{(className, renderFileInput, handleLoadProject) => (
* <MyCoolComponent
* onClick={loadProject}
* className={className}
* onClick={handleLoadProject}
* >
* {renderFileInput()}
* </MyCoolComponent>
@@ -94,21 +95,28 @@ class SBFileUploader extends React.Component {
intl,
isShowingWithoutId,
loadingState,
projectChanged
projectChanged,
userOwnsProject
} = this.props;
const thisFileInput = e.target;
if (thisFileInput.files) { // Don't attempt to load if no file was selected
this.fileToUpload = thisFileInput.files[0];
// Allow upload to continue only after confirmation if the project
// has changed and is not showing with ID. If it has an ID, this operation
// does not currently overwrite that project, so it is safe to do without confirmation.
const uploadAllowed = (isShowingWithoutId && projectChanged) ?
confirm(intl.formatMessage(sharedMessages.replaceProjectWarning)) : // eslint-disable-line no-alert
true;
if (uploadAllowed) this.props.requestProjectUpload(loadingState);
// If user owns the project, or user has changed the project,
// we must confirm with the user that they really intend to replace it.
// (If they don't own the project and haven't changed it, no need to confirm.)
let uploadAllowed = true;
if (userOwnsProject || (projectChanged && isShowingWithoutId)) {
uploadAllowed = confirm( // eslint-disable-line no-alert
intl.formatMessage(sharedMessages.replaceProjectWarning)
);
}
if (uploadAllowed) {
this.props.requestProjectUpload(loadingState);
} else {
this.props.closeFileMenu();
}
}
}
// called when file upload raw data is available in the reader
@@ -118,12 +126,6 @@ class SBFileUploader extends React.Component {
const filename = this.fileToUpload && this.fileToUpload.name;
this.props.vm.loadProject(this.reader.result)
.then(() => {
// Remove the hash if any (without triggering a hash change event or a reload)
try { // Can fail e.g. when GUI is loaded from static file (integration tests)
history.replaceState({}, document.title, '.');
} catch {
// No fallback, just do not trigger promise catch below
}
this.props.onLoadingFinished(this.props.loadingState, true);
// Reset the file input after project is loaded
// This is necessary in case the user wants to reload a project
@@ -170,6 +172,7 @@ SBFileUploader.propTypes = {
canSave: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
children: PropTypes.func,
className: PropTypes.string,
closeFileMenu: PropTypes.func,
intl: intlShape.isRequired,
isLoadingUpload: PropTypes.bool,
isShowingWithoutId: PropTypes.bool,
@@ -179,6 +182,7 @@ SBFileUploader.propTypes = {
onUpdateProjectTitle: PropTypes.func,
projectChanged: PropTypes.bool,
requestProjectUpload: PropTypes.func,
userOwnsProject: PropTypes.bool,
vm: PropTypes.shape({
loadProject: PropTypes.func
})
@@ -198,6 +202,7 @@ const mapStateToProps = state => {
};
const mapDispatchToProps = (dispatch, ownProps) => ({
closeFileMenu: () => dispatch(closeFileMenu()),
onLoadingFinished: (loadingState, success) => {
dispatch(onLoadedProject(loadingState, ownProps.canSave, success));
dispatch(closeLoadingProject());
+2 -2
View File
@@ -54,10 +54,10 @@ class ScanningStep extends React.Component {
render () {
return (
<ScanningStepComponent
connectionSmallIconURL={this.props.connectionSmallIconURL}
peripheralList={this.state.peripheralList}
phase={this.state.phase}
scanning={this.state.scanning}
smallPeripheralImage={this.props.smallPeripheralImage}
title={this.props.extensionId}
onConnected={this.props.onConnected}
onConnecting={this.props.onConnecting}
@@ -68,10 +68,10 @@ class ScanningStep extends React.Component {
}
ScanningStep.propTypes = {
connectionSmallIconURL: PropTypes.string,
extensionId: PropTypes.string.isRequired,
onConnected: PropTypes.func.isRequired,
onConnecting: PropTypes.func.isRequired,
smallPeripheralImage: PropTypes.string,
vm: PropTypes.instanceOf(VM).isRequired
};
+252 -45
View File
@@ -2,10 +2,11 @@ import bindAll from 'lodash.bindall';
import PropTypes from 'prop-types';
import React from 'react';
import WavEncoder from 'wav-encoder';
import VM from 'scratch-vm';
import {connect} from 'react-redux';
import {computeChunkedRMS, SOUND_BYTE_LIMIT} from '../lib/audio/audio-util.js';
import {computeChunkedRMS, encodeAndAddSoundToVM, SOUND_BYTE_LIMIT} from '../lib/audio/audio-util.js';
import AudioEffects from '../lib/audio/audio-effects.js';
import SoundEditorComponent from '../components/sound-editor/sound-editor.jsx';
import AudioBufferPlayer from '../lib/audio/audio-buffer-player.js';
@@ -17,21 +18,29 @@ class SoundEditor extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'copy',
'copyCurrentBuffer',
'handleCopyToNew',
'handleStoppedPlaying',
'handleChangeName',
'handlePlay',
'handleStopPlaying',
'handleUpdatePlayhead',
'handleActivateTrim',
'handleUpdateTrimEnd',
'handleUpdateTrimStart',
'handleDelete',
'handleUpdateTrim',
'handleEffect',
'handleUndo',
'handleRedo',
'submitNewSamples'
'submitNewSamples',
'handleCopy',
'handlePaste',
'paste',
'handleKeyPress',
'handleContainerClick',
'setRef'
]);
this.state = {
copyBuffer: null,
chunkLevels: computeChunkedRMS(this.props.samples),
playhead: null, // null is not playing, [0 -> 1] is playing percent
trimStart: null,
@@ -40,28 +49,84 @@ class SoundEditor extends React.Component {
this.redoStack = [];
this.undoStack = [];
this.ref = null;
}
componentDidMount () {
this.audioBufferPlayer = new AudioBufferPlayer(this.props.samples, this.props.sampleRate);
document.addEventListener('keydown', this.handleKeyPress);
}
componentWillReceiveProps (newProps) {
if (newProps.soundId !== this.props.soundId) { // A different sound has been selected
this.redoStack = [];
this.undoStack = [];
this.resetState(newProps.samples, newProps.sampleRate);
this.setState({
trimStart: null,
trimEnd: null
});
}
}
componentWillUnmount () {
this.audioBufferPlayer.stop();
document.removeEventListener('keydown', this.handleKeyPress);
}
handleKeyPress (event) {
if (event.target instanceof HTMLInputElement) {
// Ignore keyboard shortcuts if a text input field is focused
return;
}
if (event.key === ' ') {
event.preventDefault();
if (this.state.playhead) {
this.handleStopPlaying();
} else {
this.handlePlay();
}
}
if (event.key === 'Delete' || event.key === 'Backspace') {
event.preventDefault();
if (event.shiftKey) {
this.handleDeleteInverse();
} else {
this.handleDelete();
}
}
if (event.key === 'Escape') {
event.preventDefault();
this.handleUpdateTrim(null, null);
}
if (event.metaKey || event.ctrlKey) {
if (event.shiftKey && event.key.toLowerCase() === 'z') {
event.preventDefault();
if (this.redoStack.length > 0) {
this.handleRedo();
}
} else if (event.key === 'z') {
if (this.undoStack.length > 0) {
event.preventDefault();
this.handleUndo();
}
} else if (event.key === 'c') {
event.preventDefault();
this.handleCopy();
} else if (event.key === 'v') {
event.preventDefault();
this.handlePaste();
} else if (event.key === 'a') {
event.preventDefault();
this.handleUpdateTrim(0, 1);
}
}
}
resetState (samples, sampleRate) {
this.audioBufferPlayer.stop();
this.audioBufferPlayer = new AudioBufferPlayer(samples, sampleRate);
this.setState({
chunkLevels: computeChunkedRMS(samples),
playhead: null,
trimStart: null,
trimEnd: null
playhead: null
});
}
submitNewSamples (samples, sampleRate, skipUndo) {
@@ -93,7 +158,7 @@ class SoundEditor extends React.Component {
if (this.undoStack.length >= UNDO_STACK_SIZE) {
this.undoStack.shift(); // Drop the first element off the array
}
this.undoStack.push(this.copyCurrentBuffer());
this.undoStack.push(this.getUndoItem());
}
this.resetState(samples, sampleRate);
this.props.vm.updateSoundBuffer(
@@ -106,6 +171,7 @@ class SoundEditor extends React.Component {
return false; // Update failed
}
handlePlay () {
this.audioBufferPlayer.stop();
this.audioBufferPlayer.play(
this.state.trimStart || 0,
this.state.trimEnd || 1,
@@ -125,31 +191,46 @@ class SoundEditor extends React.Component {
handleChangeName (name) {
this.props.vm.renameSound(this.props.soundIndex, name);
}
handleActivateTrim () {
if (this.state.trimStart === null && this.state.trimEnd === null) {
this.setState({trimEnd: 0.95, trimStart: 0.05});
handleDelete () {
const {samples, sampleRate} = this.copyCurrentBuffer();
const sampleCount = samples.length;
const startIndex = Math.floor(this.state.trimStart * sampleCount);
const endIndex = Math.floor(this.state.trimEnd * sampleCount);
const firstPart = samples.slice(0, startIndex);
const secondPart = samples.slice(endIndex, sampleCount);
const newLength = firstPart.length + secondPart.length;
let newSamples;
if (newLength === 0) {
newSamples = new Float32Array(1);
} else {
const {samples, sampleRate} = this.copyCurrentBuffer();
const sampleCount = samples.length;
const startIndex = Math.floor(this.state.trimStart * sampleCount);
const endIndex = Math.floor(this.state.trimEnd * sampleCount);
if (endIndex > startIndex) { // Strictly greater to prevent 0 sample sounds
const clippedSamples = samples.slice(startIndex, endIndex);
this.submitNewSamples(clippedSamples, sampleRate);
} else {
// Just clear the trim state, it cannot be completed
this.setState({
trimStart: null,
trimEnd: null
});
}
newSamples = new Float32Array(newLength);
newSamples.set(firstPart, 0);
newSamples.set(secondPart, firstPart.length);
}
this.submitNewSamples(newSamples, sampleRate);
this.setState({
trimStart: null,
trimEnd: null
});
}
handleUpdateTrimEnd (trimEnd) {
this.setState({trimEnd});
handleDeleteInverse () {
const {samples, sampleRate} = this.copyCurrentBuffer();
const sampleCount = samples.length;
const startIndex = Math.floor(this.state.trimStart * sampleCount);
const endIndex = Math.floor(this.state.trimEnd * sampleCount);
let clippedSamples = samples.slice(startIndex, endIndex);
if (clippedSamples.length === 0) {
clippedSamples = new Float32Array(1);
}
this.submitNewSamples(clippedSamples, sampleRate);
this.setState({
trimStart: null,
trimEnd: null
});
}
handleUpdateTrimStart (trimStart) {
this.setState({trimStart});
handleUpdateTrim (trimStart, trimEnd) {
this.setState({trimStart, trimEnd});
this.handleStopPlaying();
}
effectFactory (name) {
return () => this.handleEffect(name);
@@ -162,52 +243,181 @@ class SoundEditor extends React.Component {
};
}
handleEffect (name) {
const effects = new AudioEffects(this.audioBufferPlayer.buffer, name);
effects.process(({renderedBuffer}) => {
const trimStart = this.state.trimStart === null ? 0.0 : this.state.trimStart;
const trimEnd = this.state.trimEnd === null ? 1.0 : this.state.trimEnd;
// Offline audio context needs at least 2 samples
if (this.audioBufferPlayer.buffer.length < 2) {
return;
}
const effects = new AudioEffects(this.audioBufferPlayer.buffer, name, trimStart, trimEnd);
effects.process((renderedBuffer, adjustedTrimStart, adjustedTrimEnd) => {
const samples = renderedBuffer.getChannelData(0);
const sampleRate = renderedBuffer.sampleRate;
const success = this.submitNewSamples(samples, sampleRate);
if (success) this.handlePlay();
if (success) {
if (this.state.trimStart === null) {
this.handlePlay();
} else {
this.setState({trimStart: adjustedTrimStart, trimEnd: adjustedTrimEnd}, this.handlePlay);
}
}
});
}
getUndoItem () {
return {
...this.copyCurrentBuffer(),
trimStart: this.state.trimStart,
trimEnd: this.state.trimEnd
};
}
handleUndo () {
this.redoStack.push(this.copyCurrentBuffer());
const {samples, sampleRate} = this.undoStack.pop();
this.redoStack.push(this.getUndoItem());
const {samples, sampleRate, trimStart, trimEnd} = this.undoStack.pop();
if (samples) {
this.submitNewSamples(samples, sampleRate, true);
this.handlePlay();
this.setState({trimStart: trimStart, trimEnd: trimEnd}, this.handlePlay);
}
}
handleRedo () {
const {samples, sampleRate} = this.redoStack.pop();
const {samples, sampleRate, trimStart, trimEnd} = this.redoStack.pop();
if (samples) {
this.undoStack.push(this.copyCurrentBuffer());
this.undoStack.push(this.getUndoItem());
this.submitNewSamples(samples, sampleRate, true);
this.setState({trimStart: trimStart, trimEnd: trimEnd}, this.handlePlay);
}
}
handleCopy () {
this.copy();
}
copy (callback) {
const trimStart = this.state.trimStart === null ? 0.0 : this.state.trimStart;
const trimEnd = this.state.trimEnd === null ? 1.0 : this.state.trimEnd;
const newCopyBuffer = this.copyCurrentBuffer();
const trimStartSamples = trimStart * newCopyBuffer.samples.length;
const trimEndSamples = trimEnd * newCopyBuffer.samples.length;
newCopyBuffer.samples = newCopyBuffer.samples.slice(trimStartSamples, trimEndSamples);
this.setState({
copyBuffer: newCopyBuffer
}, callback);
}
handleCopyToNew () {
this.copy(() => {
encodeAndAddSoundToVM(this.props.vm, this.state.copyBuffer.samples,
this.state.copyBuffer.sampleRate, this.props.name);
});
}
resampleBufferToRate (buffer, newRate) {
return new Promise(resolve => {
if (window.OfflineAudioContext) {
const sampleRateRatio = newRate / buffer.sampleRate;
const newLength = sampleRateRatio * buffer.samples.length;
const offlineContext = new window.OfflineAudioContext(1, newLength, newRate);
const source = offlineContext.createBufferSource();
const audioBuffer = offlineContext.createBuffer(1, buffer.samples.length, buffer.sampleRate);
audioBuffer.getChannelData(0).set(buffer.samples);
source.buffer = audioBuffer;
source.connect(offlineContext.destination);
source.start();
offlineContext.startRendering();
offlineContext.oncomplete = ({renderedBuffer}) => {
resolve({
samples: renderedBuffer.getChannelData(0),
sampleRate: newRate
});
};
}
});
}
paste () {
// If there's no selection, paste at the end of the sound
const {samples} = this.copyCurrentBuffer();
if (this.state.trimStart === null) {
const newLength = samples.length + this.state.copyBuffer.samples.length;
const newSamples = new Float32Array(newLength);
newSamples.set(samples, 0);
newSamples.set(this.state.copyBuffer.samples, samples.length);
this.submitNewSamples(newSamples, this.props.sampleRate, false);
this.handlePlay();
} else {
// else replace the selection with the pasted sound
const trimStartSamples = this.state.trimStart * samples.length;
const trimEndSamples = this.state.trimEnd * samples.length;
const firstPart = samples.slice(0, trimStartSamples);
const lastPart = samples.slice(trimEndSamples);
const newLength = firstPart.length + this.state.copyBuffer.samples.length + lastPart.length;
const newSamples = new Float32Array(newLength);
newSamples.set(firstPart, 0);
newSamples.set(this.state.copyBuffer.samples, firstPart.length);
newSamples.set(lastPart, firstPart.length + this.state.copyBuffer.samples.length);
const trimStartSeconds = trimStartSamples / this.props.sampleRate;
const trimEndSeconds = trimStartSeconds +
(this.state.copyBuffer.samples.length / this.state.copyBuffer.sampleRate);
const newDurationSeconds = newSamples.length / this.state.copyBuffer.sampleRate;
const adjustedTrimStart = trimStartSeconds / newDurationSeconds;
const adjustedTrimEnd = trimEndSeconds / newDurationSeconds;
this.submitNewSamples(newSamples, this.props.sampleRate, false);
this.setState({
trimStart: adjustedTrimStart,
trimEnd: adjustedTrimEnd
}, this.handlePlay);
}
}
handlePaste () {
if (!this.state.copyBuffer) return;
if (this.state.copyBuffer.sampleRate === this.props.sampleRate) {
this.paste();
} else {
this.resampleBufferToRate(this.state.copyBuffer, this.props.sampleRate).then(buffer => {
this.setState({
copyBuffer: buffer
}, this.paste);
});
}
}
setRef (element) {
this.ref = element;
}
handleContainerClick (e) {
// If the click is on the sound editor's div (and not any other element), delesect
if (e.target === this.ref && this.state.trimStart !== null) {
this.handleUpdateTrim(null, null);
}
}
render () {
const {effectTypes} = AudioEffects;
return (
<SoundEditorComponent
canPaste={this.state.copyBuffer !== null}
canRedo={this.redoStack.length > 0}
canUndo={this.undoStack.length > 0}
chunkLevels={this.state.chunkLevels}
name={this.props.name}
playhead={this.state.playhead}
setRef={this.setRef}
trimEnd={this.state.trimEnd}
trimStart={this.state.trimStart}
onActivateTrim={this.handleActivateTrim}
onChangeName={this.handleChangeName}
onContainerClick={this.handleContainerClick}
onCopy={this.handleCopy}
onCopyToNew={this.handleCopyToNew}
onDelete={this.handleDelete}
onEcho={this.effectFactory(effectTypes.ECHO)}
onFadeIn={this.effectFactory(effectTypes.FADEIN)}
onFadeOut={this.effectFactory(effectTypes.FADEOUT)}
onFaster={this.effectFactory(effectTypes.FASTER)}
onLouder={this.effectFactory(effectTypes.LOUDER)}
onMute={this.effectFactory(effectTypes.MUTE)}
onPaste={this.handlePaste}
onPlay={this.handlePlay}
onRedo={this.handleRedo}
onReverse={this.effectFactory(effectTypes.REVERSE)}
onRobot={this.effectFactory(effectTypes.ROBOT)}
onSetTrimEnd={this.handleUpdateTrimEnd}
onSetTrimStart={this.handleUpdateTrimStart}
onSetTrim={this.handleUpdateTrim}
onSlower={this.effectFactory(effectTypes.SLOWER)}
onSofter={this.effectFactory(effectTypes.SOFTER)}
onStop={this.handleStopPlaying}
@@ -223,10 +433,7 @@ SoundEditor.propTypes = {
samples: PropTypes.instanceOf(Float32Array),
soundId: PropTypes.string,
soundIndex: PropTypes.number,
vm: PropTypes.shape({
updateSoundBuffer: PropTypes.func,
renameSound: PropTypes.func
})
vm: PropTypes.instanceOf(VM).isRequired
};
const mapStateToProps = (state, {soundIndex}) => {
+25 -3
View File
@@ -7,8 +7,8 @@ import AudioEngine from 'scratch-audio';
import LibraryComponent from '../components/library/library.jsx';
import soundIcon from '../components/asset-panel/icon--sound.svg';
import soundIconRtl from '../components/asset-panel/icon--sound-rtl.svg';
import soundIcon from '../components/library-item/lib-icon--sound.svg';
import soundIconRtl from '../components/library-item/lib-icon--sound-rtl.svg';
import soundLibraryContent from '../lib/libraries/sounds.json';
import soundTags from '../lib/libraries/sound-tags';
@@ -29,7 +29,9 @@ class SoundLibrary extends React.PureComponent {
bindAll(this, [
'handleItemSelected',
'handleItemMouseEnter',
'handleItemMouseLeave'
'handleItemMouseLeave',
'onStop',
'setStopHandler'
]);
/**
@@ -43,6 +45,11 @@ class SoundLibrary extends React.PureComponent {
* @type {Promise<SoundPlayer>}
*/
this.playingSoundPromise = null;
/**
* function to call when the sound ends
*/
this.handleStop = null;
}
componentDidMount () {
this.audioEngine = new AudioEngine();
@@ -51,10 +58,22 @@ class SoundLibrary extends React.PureComponent {
componentWillUnmount () {
this.stopPlayingSound();
}
onStop () {
if (this.playingSoundPromise !== null) {
this.playingSoundPromise.then(soundPlayer => soundPlayer.removeListener('stop', this.onStop));
if (this.handleStop) this.handleStop();
}
}
setStopHandler (func) {
this.handleStop = func;
}
stopPlayingSound () {
// Playback is queued, playing, or has played recently and finished
// normally.
if (this.playingSoundPromise !== null) {
// Forcing sound to stop, so stop listening for sound ending:
this.playingSoundPromise.then(soundPlayer => soundPlayer.removeListener('stop', this.onStop));
// Queued playback began playing before this method.
if (this.playingSoundPromise.isPlaying) {
// Fetch the player from the promise and stop playback soon.
@@ -102,6 +121,7 @@ class SoundLibrary extends React.PureComponent {
// Play the sound. Playing the sound will always come before a
// paired stop if the sound must stop early.
soundPlayer.play();
soundPlayer.addListener('stop', this.onStop);
// Set that the sound is playing. This affects the type of stop
// instruction given if the sound must stop early.
if (this.playingSoundPromise !== null) {
@@ -141,8 +161,10 @@ class SoundLibrary extends React.PureComponent {
return (
<LibraryComponent
showPlayButton
data={soundLibraryThumbnailData}
id="soundLibrary"
setStopHandler={this.setStopHandler}
tags={soundTags}
title={this.props.intl.formatMessage(messages.libraryTitle)}
onItemMouseEnter={this.handleItemMouseEnter}
+42 -31
View File
@@ -6,19 +6,19 @@ import {connect} from 'react-redux';
import {setHoveredSprite} from '../reducers/hovered-target';
import {updateAssetDrag} from '../reducers/asset-drag';
import storage from '../lib/storage';
import {getEventXY} from '../lib/touch-utils';
import VM from 'scratch-vm';
import getCostumeUrl from '../lib/get-costume-url';
import DragRecognizer from '../lib/drag-recognizer';
import {getEventXY} from '../lib/touch-utils';
import SpriteSelectorItemComponent from '../components/sprite-selector-item/sprite-selector-item.jsx';
const dragThreshold = 3; // Same as the block drag threshold
class SpriteSelectorItem extends React.PureComponent {
constructor (props) {
super(props);
bindAll(this, [
'getCostumeData',
'setRef',
'handleClick',
'handleDelete',
'handleDuplicate',
@@ -26,9 +26,22 @@ class SpriteSelectorItem extends React.PureComponent {
'handleMouseEnter',
'handleMouseLeave',
'handleMouseDown',
'handleMouseMove',
'handleMouseUp'
'handleDragEnd',
'handleDrag',
'handleTouchEnd'
]);
this.dragRecognizer = new DragRecognizer({
onDrag: this.handleDrag,
onDragEnd: this.handleDragEnd
});
}
componentDidMount () {
document.addEventListener('touchend', this.handleTouchEnd);
}
componentWillUnmount () {
document.removeEventListener('touchend', this.handleTouchEnd);
this.dragRecognizer.reset();
}
getCostumeData () {
if (this.props.costumeURL) return this.props.costumeURL;
@@ -36,12 +49,7 @@ class SpriteSelectorItem extends React.PureComponent {
return getCostumeUrl(this.props.asset);
}
handleMouseUp () {
this.initialOffset = null;
window.removeEventListener('mouseup', this.handleMouseUp);
window.removeEventListener('mousemove', this.handleMouseMove);
window.removeEventListener('touchend', this.handleMouseUp);
window.removeEventListener('touchmove', this.handleMouseMove);
handleDragEnd () {
if (this.props.dragging) {
this.props.onDrag({
img: null,
@@ -55,29 +63,26 @@ class SpriteSelectorItem extends React.PureComponent {
this.noClick = false;
});
}
handleMouseMove (e) {
const currentOffset = getEventXY(e);
const dx = currentOffset.x - this.initialOffset.x;
const dy = currentOffset.y - this.initialOffset.y;
if (Math.sqrt((dx * dx) + (dy * dy)) > dragThreshold) {
this.props.onDrag({
img: this.getCostumeData(),
currentOffset: currentOffset,
dragging: true,
dragType: this.props.dragType,
index: this.props.index,
payload: this.props.dragPayload
});
this.noClick = true;
handleDrag (currentOffset) {
this.props.onDrag({
img: this.getCostumeData(),
currentOffset: currentOffset,
dragging: true,
dragType: this.props.dragType,
index: this.props.index,
payload: this.props.dragPayload
});
this.noClick = true;
}
handleTouchEnd (e) {
const {x, y} = getEventXY(e);
const {top, left, bottom, right} = this.ref.getBoundingClientRect();
if (x >= left && x <= right && y >= top && y <= bottom) {
this.handleMouseEnter();
}
e.preventDefault();
}
handleMouseDown (e) {
this.initialOffset = getEventXY(e);
window.addEventListener('mouseup', this.handleMouseUp);
window.addEventListener('mousemove', this.handleMouseMove);
window.addEventListener('touchend', this.handleMouseUp);
window.addEventListener('touchmove', this.handleMouseMove);
this.dragRecognizer.start(e);
}
handleClick (e) {
e.preventDefault();
@@ -103,6 +108,10 @@ class SpriteSelectorItem extends React.PureComponent {
handleMouseEnter () {
this.props.dispatchSetHoveredSprite(this.props.id);
}
setRef (component) {
// Access the DOM node using .elem because it is going through ContextMenuTrigger
this.ref = component && component.elem;
}
render () {
const {
/* eslint-disable no-unused-vars */
@@ -122,7 +131,9 @@ class SpriteSelectorItem extends React.PureComponent {
} = this.props;
return (
<SpriteSelectorItemComponent
componentRef={this.setRef}
costumeURL={this.getCostumeData()}
preventContextMenu={this.dragRecognizer.gestureInProgress()}
onClick={this.handleClick}
onDeleteButtonClick={onDeleteButtonClick ? this.handleDelete : null}
onDuplicateButtonClick={onDuplicateButtonClick ? this.handleDuplicate : null}
+38 -11
View File
@@ -15,6 +15,7 @@ import ThrottledPropertyHOC from '../lib/throttled-property-hoc.jsx';
import {emptyCostume} from '../lib/empty-assets';
import sharedMessages from '../lib/shared-messages';
import {fetchCode} from '../lib/backpack-api';
import {getEventXY} from '../lib/touch-utils';
import StageSelectorComponent from '../components/stage-selector/stage-selector.jsx';
@@ -46,11 +47,26 @@ class StageSelector extends React.Component {
'handleBackdropUpload',
'handleMouseEnter',
'handleMouseLeave',
'handleTouchEnd',
'handleDrop',
'setFileInput'
'setFileInput',
'setRef'
]);
}
addBackdropFromLibraryItem (item) {
componentDidMount () {
document.addEventListener('touchend', this.handleTouchEnd);
}
componentWillUnmount () {
document.removeEventListener('touchend', this.handleTouchEnd);
}
handleTouchEnd (e) {
const {x, y} = getEventXY(e);
const {top, left, bottom, right} = this.ref.getBoundingClientRect();
if (x >= left && x <= right && y >= top && y <= bottom) {
this.handleMouseEnter();
}
}
addBackdropFromLibraryItem (item, shouldActivateTab = true) {
const vmBackdrop = {
name: item.name,
md5: item.md5,
@@ -59,25 +75,30 @@ class StageSelector extends React.Component {
bitmapResolution: item.info.length > 2 ? item.info[2] : 1,
skinId: null
};
this.handleNewBackdrop(vmBackdrop);
this.handleNewBackdrop(vmBackdrop, shouldActivateTab);
}
handleClick () {
this.props.onSelect(this.props.id);
}
handleNewBackdrop (backdrops_) {
handleNewBackdrop (backdrops_, shouldActivateTab = true) {
const backdrops = Array.isArray(backdrops_) ? backdrops_ : [backdrops_];
return Promise.all(backdrops.map(backdrop =>
this.props.vm.addBackdrop(backdrop.md5, backdrop)
)).then(() =>
this.props.onActivateTab(COSTUMES_TAB_INDEX)
);
)).then(() => {
if (shouldActivateTab) {
return this.props.onActivateTab(COSTUMES_TAB_INDEX);
}
});
}
handleSurpriseBackdrop () {
handleSurpriseBackdrop (e) {
e.stopPropagation(); // Prevent click from falling through to selecting stage.
// @todo should this not add a backdrop you already have?
const item = backdropLibraryContent[Math.floor(Math.random() * backdropLibraryContent.length)];
this.addBackdropFromLibraryItem(item);
this.addBackdropFromLibraryItem(item, false);
}
handleEmptyBackdrop () {
handleEmptyBackdrop (e) {
e.stopPropagation(); // Prevent click from falling through to stage selector, select it manually below
this.props.vm.setEditingTarget(this.props.id);
this.handleNewBackdrop(emptyCostume(this.props.intl.formatMessage(sharedMessages.backdrop, {index: 1})));
}
handleBackdropUpload (e) {
@@ -85,6 +106,7 @@ class StageSelector extends React.Component {
this.props.onShowImporting();
handleFileUpload(e.target, (buffer, fileType, fileName, fileIndex, fileCount) => {
costumeUpload(buffer, fileType, storage, vmCostumes => {
this.props.vm.setEditingTarget(this.props.id);
vmCostumes.forEach((costume, i) => {
costume.name = `${fileName}${i ? i + 1 : ''}`;
});
@@ -96,7 +118,8 @@ class StageSelector extends React.Component {
}, this.props.onCloseImporting);
}, this.props.onCloseImporting);
}
handleFileUploadClick () {
handleFileUploadClick (e) {
e.stopPropagation(); // Prevent click from selecting the stage, that is handled manually in backdrop upload
this.fileInput.click();
}
handleMouseEnter () {
@@ -130,12 +153,16 @@ class StageSelector extends React.Component {
setFileInput (input) {
this.fileInput = input;
}
setRef (ref) {
this.ref = ref;
}
render () {
const componentProps = omit(this.props, [
'asset', 'dispatchSetHoveredSprite', 'id', 'intl',
'onActivateTab', 'onSelect', 'onShowImporting', 'onCloseImporting']);
return (
<DroppableThrottledStage
componentRef={this.setRef}
fileInputRef={this.setFileInput}
onBackdropFileUpload={this.handleBackdropUpload}
onBackdropFileUploadClick={this.handleFileUploadClick}
+1
View File
@@ -423,6 +423,7 @@ class Stage extends React.Component {
Stage.propTypes = {
isColorPicking: PropTypes.bool,
isFullScreen: PropTypes.bool.isRequired,
isStarted: PropTypes.bool,
micIndicator: PropTypes.bool,
onActivateColorPicker: PropTypes.func,
onDeactivateColorPicker: PropTypes.func,
+11 -6
View File
@@ -105,7 +105,10 @@ class TargetPane extends React.Component {
}
}
handleSurpriseSpriteClick () {
const item = spriteLibraryContent[Math.floor(Math.random() * spriteLibraryContent.length)];
const surpriseSprites = spriteLibraryContent.filter(sprite =>
(sprite.tags.indexOf('letters') === -1) && (sprite.tags.indexOf('numbers') === -1)
);
const item = surpriseSprites[Math.floor(Math.random() * surpriseSprites.length)];
randomizeSpritePosition(item);
this.props.vm.addSprite(JSON.stringify(item.json))
.then(this.handleActivateBlocksTab);
@@ -138,11 +141,13 @@ class TargetPane extends React.Component {
this.props.onShowImporting();
handleFileUpload(e.target, (buffer, fileType, fileName, fileIndex, fileCount) => {
spriteUpload(buffer, fileType, fileName, storage, newSprite => {
this.handleNewSprite(newSprite).then(() => {
if (fileIndex === fileCount - 1) {
this.props.onCloseImporting();
}
});
this.handleNewSprite(newSprite)
.then(() => {
if (fileIndex === fileCount - 1) {
this.props.onCloseImporting();
}
})
.catch(this.props.onCloseImporting);
}, this.props.onCloseImporting);
}, this.props.onCloseImporting);
}
+9 -3
View File
@@ -62,10 +62,16 @@ class TipsLibrary extends React.PureComponent {
}
render () {
const decksLibraryThumbnailData = Object.keys(decksLibraryContent)
.filter(id =>
.filter(id => {
if (notScratchDesktop()) return true; // Do not filter anything in online editor
const deck = decksLibraryContent[id];
// Scratch Desktop doesn't want tutorials with `requiredProjectId`
notScratchDesktop() || !decksLibraryContent[id].hasOwnProperty('requiredProjectId')
)
if (deck.hasOwnProperty('requiredProjectId')) return false;
// Scratch Desktop should not load tutorials that are _only_ videos
if (deck.steps.filter(s => s.title).length === 0) return false;
// Allow any other tutorials
return true;
})
.map(id => ({
rawURL: decksLibraryContent[id].img,
id: id,
+2
View File
@@ -1,5 +1,6 @@
import GUI from './containers/gui.jsx';
import AppStateHOC from './lib/app-state-hoc.jsx';
import TitledHOC from './lib/titled-hoc.jsx';
import GuiReducer, {guiInitialState, guiMiddleware, initEmbedded, initFullScreen, initPlayer} from './reducers/gui';
import LocalesReducer, {localesInitialState, initLocale} from './reducers/locales';
import {ScratchPaintReducer} from 'scratch-paint';
@@ -16,6 +17,7 @@ const guiReducers = {
export {
GUI as default,
AppStateHOC,
TitledHOC,
setAppElement,
guiReducers,
guiInitialState,
+2 -1
View File
@@ -113,7 +113,8 @@ const AppStateHOC = function (WrappedComponent, localesOnly) {
}
AppStateWrapper.propTypes = {
isFullScreen: PropTypes.bool,
isPlayerOnly: PropTypes.bool
isPlayerOnly: PropTypes.bool,
showTelemetryModal: PropTypes.bool
};
return AppStateWrapper;
};
+73 -15
View File
@@ -1,6 +1,8 @@
import EchoEffect from './effects/echo-effect.js';
import RobotEffect from './effects/robot-effect.js';
import VolumeEffect from './effects/volume-effect.js';
import FadeEffect from './effects/fade-effect.js';
import MuteEffect from './effects/mute-effect.js';
const effectTypes = {
ROBOT: 'robot',
@@ -9,32 +11,56 @@ const effectTypes = {
SOFTER: 'lower',
FASTER: 'faster',
SLOWER: 'slower',
ECHO: 'echo'
ECHO: 'echo',
FADEIN: 'fade in',
FADEOUT: 'fade out',
MUTE: 'mute'
};
class AudioEffects {
static get effectTypes () {
return effectTypes;
}
constructor (buffer, name) {
constructor (buffer, name, trimStart, trimEnd) {
this.trimStartSeconds = (trimStart * buffer.length) / buffer.sampleRate;
this.trimEndSeconds = (trimEnd * buffer.length) / buffer.sampleRate;
this.adjustedTrimStartSeconds = this.trimStartSeconds;
this.adjustedTrimEndSeconds = this.trimEndSeconds;
// Some effects will modify the playback rate and/or number of samples.
// Need to precompute those values to create the offline audio context.
const pitchRatio = Math.pow(2, 4 / 12); // A major third
let sampleCount = buffer.length;
let playbackRate = 1;
const affectedSampleCount = Math.floor((this.trimEndSeconds - this.trimStartSeconds) *
buffer.sampleRate);
let adjustedAffectedSampleCount = affectedSampleCount;
const unaffectedSampleCount = sampleCount - affectedSampleCount;
this.playbackRate = 1;
switch (name) {
case effectTypes.ECHO:
sampleCount = buffer.length + (0.25 * 3 * buffer.sampleRate);
sampleCount = Math.max(sampleCount,
Math.floor((this.trimEndSeconds + EchoEffect.TAIL_SECONDS) * buffer.sampleRate));
break;
case effectTypes.FASTER:
playbackRate = pitchRatio;
sampleCount = Math.floor(buffer.length / playbackRate);
this.playbackRate = pitchRatio;
adjustedAffectedSampleCount = Math.floor(affectedSampleCount / this.playbackRate);
sampleCount = unaffectedSampleCount + adjustedAffectedSampleCount;
break;
case effectTypes.SLOWER:
playbackRate = 1 / pitchRatio;
sampleCount = Math.floor(buffer.length / playbackRate);
this.playbackRate = 1 / pitchRatio;
adjustedAffectedSampleCount = Math.floor(affectedSampleCount / this.playbackRate);
sampleCount = unaffectedSampleCount + adjustedAffectedSampleCount;
break;
}
const durationSeconds = sampleCount / buffer.sampleRate;
this.adjustedTrimEndSeconds = this.trimStartSeconds +
(adjustedAffectedSampleCount / buffer.sampleRate);
this.adjustedTrimStart = this.adjustedTrimStartSeconds / durationSeconds;
this.adjustedTrimEnd = this.adjustedTrimEndSeconds / durationSeconds;
if (window.OfflineAudioContext) {
this.audioContext = new window.OfflineAudioContext(1, sampleCount, buffer.sampleRate);
} else {
@@ -52,8 +78,17 @@ class AudioEffects {
const newBuffer = this.audioContext.createBuffer(1, buffer.length, buffer.sampleRate);
const newBufferData = newBuffer.getChannelData(0);
const bufferLength = buffer.length;
const startSamples = Math.floor(this.trimStartSeconds * buffer.sampleRate);
const endSamples = Math.floor(this.trimEndSeconds * buffer.sampleRate);
let counter = 0;
for (let i = 0; i < bufferLength; i++) {
newBufferData[i] = originalBufferData[bufferLength - i - 1];
if (i >= startSamples && i < endSamples) {
newBufferData[i] = originalBufferData[endSamples - counter - 1];
counter++;
} else {
newBufferData[i] = originalBufferData[i];
}
}
this.buffer = newBuffer;
} else {
@@ -63,7 +98,6 @@ class AudioEffects {
this.source = this.audioContext.createBufferSource();
this.source.buffer = this.buffer;
this.source.playbackRate.value = playbackRate;
this.name = name;
}
process (done) {
@@ -71,17 +105,38 @@ class AudioEffects {
let input;
let output;
switch (this.name) {
case effectTypes.FASTER:
case effectTypes.SLOWER:
this.source.playbackRate.setValueAtTime(this.playbackRate, this.adjustedTrimStartSeconds);
this.source.playbackRate.setValueAtTime(1.0, this.adjustedTrimEndSeconds);
break;
case effectTypes.LOUDER:
({input, output} = new VolumeEffect(this.audioContext, 1.25));
({input, output} = new VolumeEffect(this.audioContext, 1.25,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.SOFTER:
({input, output} = new VolumeEffect(this.audioContext, 0.75));
({input, output} = new VolumeEffect(this.audioContext, 0.75,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.ECHO:
({input, output} = new EchoEffect(this.audioContext, 0.25));
({input, output} = new EchoEffect(this.audioContext,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.ROBOT:
({input, output} = new RobotEffect(this.audioContext, 0.25));
({input, output} = new RobotEffect(this.audioContext,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.FADEIN:
({input, output} = new FadeEffect(this.audioContext, true,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.FADEOUT:
({input, output} = new FadeEffect(this.audioContext, false,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
case effectTypes.MUTE:
({input, output} = new MuteEffect(this.audioContext,
this.adjustedTrimStartSeconds, this.adjustedTrimEndSeconds));
break;
}
@@ -96,7 +151,10 @@ class AudioEffects {
this.source.start();
this.audioContext.startRendering();
this.audioContext.oncomplete = done;
this.audioContext.oncomplete = ({renderedBuffer}) => {
done(renderedBuffer, this.adjustedTrimStart, this.adjustedTrimEnd);
};
}
}
+37
View File
@@ -1,3 +1,5 @@
import WavEncoder from 'wav-encoder';
const SOUND_BYTE_LIMIT = 10 * 1000 * 1000; // 10mb
const computeRMS = function (samples, scaling = 0.55) {
@@ -23,8 +25,43 @@ const computeChunkedRMS = function (samples, chunkSize = 1024) {
return chunkLevels;
};
const encodeAndAddSoundToVM = function (vm, samples, sampleRate, name, callback) {
WavEncoder.encode({
sampleRate: sampleRate,
channelData: [samples]
}).then(wavBuffer => {
const vmSound = {
format: '',
dataFormat: 'wav',
rate: sampleRate,
sampleCount: samples.length
};
// Create an asset from the encoded .wav and get resulting md5
const storage = vm.runtime.storage;
vmSound.asset = storage.createAsset(
storage.AssetType.Sound,
storage.DataFormat.WAV,
new Uint8Array(wavBuffer),
null,
true // generate md5
);
vmSound.assetId = vmSound.asset.assetId;
// update vmSound object with md5 property
vmSound.md5 = `${vmSound.assetId}.${vmSound.dataFormat}`;
// The VM will update the sound name to a fresh name
vmSound.name = name;
vm.addSound(vmSound).then(() => {
if (callback) callback();
});
});
};
export {
computeRMS,
computeChunkedRMS,
encodeAndAddSoundToVM,
SOUND_BYTE_LIMIT
};
+12 -4
View File
@@ -1,15 +1,23 @@
class EchoEffect {
constructor (audioContext, delayTime) {
static get DELAY_TIME () {
return 0.25;
}
static get TAIL_SECONDS () {
return 0.75;
}
constructor (audioContext, startTime, endTime) {
this.audioContext = audioContext;
this.delayTime = delayTime;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.effectInput = this.audioContext.createGain();
this.effectInput.gain.value = 0.75;
this.effectInput.gain.value = 0;
this.effectInput.gain.setValueAtTime(0.75, startTime);
this.effectInput.gain.setValueAtTime(0, endTime);
this.delay = this.audioContext.createDelay(1);
this.delay.delayTime.value = delayTime;
this.delay.delayTime.value = EchoEffect.DELAY_TIME;
this.decay = this.audioContext.createGain();
this.decay.gain.value = 0.3;
+27
View File
@@ -0,0 +1,27 @@
class FadeEffect {
constructor (audioContext, fadeIn, startSeconds, endSeconds) {
this.audioContext = audioContext;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.gain = this.audioContext.createGain();
this.gain.gain.setValueAtTime(1, 0);
if (fadeIn) {
this.gain.gain.setValueAtTime(0, startSeconds);
this.gain.gain.linearRampToValueAtTime(1, endSeconds);
} else {
this.gain.gain.setValueAtTime(1, startSeconds);
this.gain.gain.linearRampToValueAtTime(0, endSeconds);
}
this.gain.gain.setValueAtTime(1, endSeconds);
this.input.connect(this.gain);
this.gain.connect(this.output);
}
}
export default FadeEffect;
+22
View File
@@ -0,0 +1,22 @@
class MuteEffect {
constructor (audioContext, startSeconds, endSeconds) {
this.audioContext = audioContext;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.gain = this.audioContext.createGain();
// Smoothly ramp the gain down before the start time, and up after the end time.
this.rampLength = 0.001;
this.gain.gain.setValueAtTime(1.0, Math.max(0, startSeconds - this.rampLength));
this.gain.gain.linearRampToValueAtTime(0, startSeconds);
this.gain.gain.setValueAtTime(0, endSeconds);
this.gain.gain.linearRampToValueAtTime(1.0, endSeconds + this.rampLength);
this.input.connect(this.gain);
this.gain.connect(this.output);
}
}
export default MuteEffect;
+20 -4
View File
@@ -1,9 +1,20 @@
class RobotEffect {
constructor (audioContext) {
constructor (audioContext, startTime, endTime) {
this.audioContext = audioContext;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.passthrough = this.audioContext.createGain();
this.effectInput = this.audioContext.createGain();
this.passthrough.gain.value = 1;
this.effectInput.gain.value = 0;
this.passthrough.gain.setValueAtTime(0, startTime);
this.passthrough.gain.setValueAtTime(1, endTime);
this.effectInput.gain.setValueAtTime(1, startTime);
this.effectInput.gain.setValueAtTime(0, endTime);
// Ring modulator inspired by BBC Dalek voice
// http://recherche.ircam.fr/pub/dafx11/Papers/66_e.pdf
@@ -70,8 +81,13 @@ class RobotEffect {
biquadFilter.frequency.value = 1000;
biquadFilter.gain.value = 1.25;
this.input.connect(vcInverter1);
this.input.connect(vcDiode4);
this.input.connect(this.effectInput);
this.input.connect(this.passthrough);
this.passthrough.connect(this.output);
this.effectInput.connect(vcInverter1);
this.effectInput.connect(vcDiode4);
vcInverter1.connect(vcDiode3);
@@ -91,7 +107,7 @@ class RobotEffect {
vcDiode3.connect(compressor);
vcDiode4.connect(compressor);
this.input.connect(biquadFilter);
this.effectInput.connect(biquadFilter);
biquadFilter.connect(compressor);
compressor.connect(this.output);
+8 -2
View File
@@ -1,12 +1,18 @@
class VolumeEffect {
constructor (audioContext, volume) {
constructor (audioContext, volume, startSeconds, endSeconds) {
this.audioContext = audioContext;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.gain = this.audioContext.createGain();
this.gain.gain.value = volume;
// Smoothly ramp the gain up before the start time, and down after the end time.
this.rampLength = 0.01;
this.gain.gain.setValueAtTime(1.0, Math.max(0, startSeconds - this.rampLength));
this.gain.gain.exponentialRampToValueAtTime(volume, startSeconds);
this.gain.gain.setValueAtTime(volume, endSeconds);
this.gain.gain.exponentialRampToValueAtTime(1.0, endSeconds + this.rampLength);
this.input.connect(this.gain);
this.gain.connect(this.output);
+22 -4
View File
@@ -246,10 +246,7 @@ export default function (vm) {
lookupBlocks = vm.runtime.flyoutBlocks;
}
const sort = function (options) {
options.sort((str1, str2) => str1.localeCompare(str2, [], {
sensitivity: 'base',
numeric: true
}));
options.sort(ScratchBlocks.scratchBlocksUtils.compareStrings);
};
// Get all the stage variables (no lists) so we can add them to menu when the stage is selected.
const stageVariableOptions = vm.runtime.getTargetForStage().getAllVariableNamesInScopeByType('');
@@ -323,5 +320,26 @@ export default function (vm) {
vm.runtime.emit('PLAY_NOTE', noteNum, extensionId);
};
// Use a collator's compare instead of localeCompare which internally
// creates a collator. Using this is a lot faster in browsers that create a
// collator for every localeCompare call.
const collator = new Intl.Collator([], {
sensitivity: 'base',
numeric: true
});
ScratchBlocks.scratchBlocksUtils.compareStrings = function (str1, str2) {
return collator.compare(str1, str2);
};
// Blocks wants to know if 3D CSS transforms are supported. The cross
// section of browsers Scratch supports and browsers that support 3D CSS
// transforms will make the return always true.
//
// Shortcutting to true lets us skip an expensive style recalculation when
// first loading the Scratch editor.
ScratchBlocks.utils.is3dSupported = function () {
return true;
};
return ScratchBlocks;
}
@@ -1,42 +0,0 @@
<svg version="1.1" id="cat" x="0px" y="0px" width="95px" height="111px" viewBox="0 0 95 111" enable-background="new 0 0 95 111" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<g id="Layer_3">
<path fill="#FAA51D" stroke="#000000" d="M22.462,79.039c-2.415-0.451-5.304-1.309-7.742-3.503&#xD;&#xA;&#x9;&#x9;C9.268,70.629,7.526,62.535,3.672,64.622c-3.856,2.088-3.782,15.165,8.353,19.194c4.182,1.391,7.998,1.396,11.091,1.312&#xD;&#xA;&#x9;&#x9;c0.811-0.025,7.717-0.654,10.079-4.074c2.361-3.42,0.719-4.272-0.09-4.744C32.295,75.838,25.878,79.677,22.462,79.039z"/>
<path fill="#FFFFFF" d="M4.236,64.877c-1.989,0.613-3.075,4.998-2.076,8.484c0.998,3.49,2.634,5.022,3.863,6.398&#xD;&#xA;&#x9;&#x9;c1.528,1.038-0.72-2.402,1.361-4.15c2.075-1.744,5.733-0.914,5.733-0.914s-2.909-3.987-4.57-6.396&#xD;&#xA;&#x9;&#x9;C6.975,65.988,6.359,64.375,4.236,64.877z"/>
</g>
<g>
<path fill="#FAA51D" d="M38.217,86.756c0,0-8.832,6.2-17.071,8.412l0.086,0.215c1.247,1.824,5.87,7.497-0.334,9.496&#xD;&#xA;&#x9;&#x9;c-5.333,1.717-15.12-13.104-10.821-15.902c2.626-1.713,4.892-0.252,4.892-0.252s3.474-1.07,6.001-2.345&#xD;&#xA;&#x9;&#x9;c4.303-2.161,5.784-3.453,5.784-3.453s4.184-4.306,6.856-4.137C36.281,78.96,41.669,83.504,38.217,86.756z"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M21.232,95.383c1.247,1.824,5.87,7.497-0.334,9.496&#xD;&#xA;&#x9;&#x9;c-5.333,1.717-15.329-13.344-11.03-16.145c2.626-1.713,5.101-0.01,5.101-0.01s3.474-1.072,6.001-2.348&#xD;&#xA;&#x9;&#x9;c4.303-2.161,5.784-3.453,5.784-3.453"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M38.217,86.756c0,0-10.123,7.107-18.804,8.819"/>
</g>
<path fill="#FAA51D" stroke="#231F20" stroke-width="1.2" d="M52.169,74.885c0,0,1.235,0.165,4.744,3.676&#xD;&#xA;&#x9;c3.509,3.508,6.026,2.16,8.911,0.724c2.877-1.443,10.537-6.126,6.49-9.817c-4.049-3.688-6.207,1.146-9.715,2.405&#xD;&#xA;&#x9;c-3.512,1.26-5.061-2.487-6.858-4.287c-0.589-0.593-1.188-1.099-1.729-1.505c0,0-0.971-0.76-1.906,2.79&#xD;&#xA;&#x9;C51.172,72.412,50.162,73.415,52.169,74.885z"/>
<g id="Layer_2_1_">
<path fill="#FAA51D" stroke="#231F20" stroke-width="1.2" d="M46.753,82.012c1.188-0.912,2.397-2.402,3.951-4.713&#xD;&#xA;&#x9;&#x9;c1.296-1.927,2.7-5.578,2.7-5.578c0.875-2.521,1.934-6.576-1.902-7.296c-1.553-0.291-4.079-0.098-7.67-0.776&#xD;&#xA;&#x9;&#x9;c-3.593-0.681-6.798-2.522-9.517,2.233c-2.718,4.757-9.59,8.271-1.056,16.563c0,0,4.901,3.842,10.764,9.639&#xD;&#xA;&#x9;&#x9;c4.831,4.775,12.045,10.602,12.045,10.602s18.972,2.188,19.535-0.693c1.922-9.79-14.777-6.911-14.777-6.911&#xD;&#xA;&#x9;&#x9;s-4.605-3.933-6.725-5.794c-3.478-3.059-11.125-10.771-11.125-10.771"/>
<path fill="#FFFFFF" d="M51.253,75.434c0,0,2.47-2.66-2.469-5.317c-4.939-2.657-7.213-0.017-8.739,1.521&#xD;&#xA;&#x9;&#x9;c-2.644,2.655,3.443,6.611,3.443,6.611l3.176,3.204c0,0,1.738-1.647,2.499-2.979C50.036,77.26,51.253,75.434,51.253,75.434"/>
</g>
<g id="Layer_8"/>
<path fill="#FAA51D" stroke="#231F20" stroke-width="1.2" d="M29.926,73.218c0.749-0.571,2.889-2.202,4.854-3.657&#xD;&#xA;&#x9;c2.428-1.799,6.117-5.849,1.077-7.646c-5.04-1.801-7.507,1.604-11.519,4.946c-2.159,1.801-5.308,2.699-4.319,6.209&#xD;&#xA;&#x9;c0.993,3.511,4.862,13.408,11.789,10.17c6.929-3.239-1.799-9.18-3.06-11.157"/>
<g id="Layer_2">
<path fill="#FAA51D" stroke="#231F20" stroke-width="1.2" d="M52.709,14.156c-1.54-0.143-4.75-0.316-6.518-0.231&#xD;&#xA;&#x9;&#x9;c-4.728,0.225-9.224,1.928-9.224,1.928L23.949,7.357l2.235,18.906c0.646-0.782-10.555,12.804-3.479,24.224&#xD;&#xA;&#x9;&#x9;c7.08,11.426,22.233,16.518,40.988,12.792c18.755-3.729,23.229-14.531,21.986-20.246c-1.242-5.714-8.322-7.823-8.322-7.823&#xD;&#xA;&#x9;&#x9;s-0.09-4.48-3.328-9.97c-1.926-3.268-8.348-8.041-8.348-8.041L62.822,5.647l-7.452,7.204L52.709,14.156z"/>
<path fill="#FFFFFF" d="M76.42,35.066l-2.482-2.064l-9.115,2.661c0,0,0,3.419-4.367,4.367c-4.37,0.951-11.211-2.277-11.211-2.277&#xD;&#xA;&#x9;&#x9;L41.46,41.17c0,0-8.437,0.928-8.739,6.081C32.048,58.704,46.1,63.479,51.425,63.783c2.905,0.167,8.235-0.338,12.277-1.141&#xD;&#xA;&#x9;&#x9;c17.752-3.234,22.551-13.919,21.31-19.635c-1.242-5.714-7.978-7.196-7.978-7.196L76.42,35.066z"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M10.673,46.155c0,0,4.107,0.374,5.974,0.268&#xD;&#xA;&#x9;&#x9;c1.865-0.107,5.492-0.587,5.492-0.587"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M81.656,40.671c0,0,4.549-0.743,6.859-1.549&#xD;&#xA;&#x9;&#x9;c2.715-0.942,4.543-2.545,4.543-2.545"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M22.337,41.909c0,0-2.384-1.777-6.117-3.43&#xD;&#xA;&#x9;&#x9;c-4.134-1.831-6.405-2.303-6.405-2.303"/>
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M82.117,46.622c0,0,2.726,1.104,5.533,1.385&#xD;&#xA;&#x9;&#x9;c2.77,0.276,4.646,0.11,4.646,0.11"/>
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-miterlimit="10" d="M52.35,14.212&#xD;&#xA;&#x9;&#x9;c2.84,0.7,3.887,1.469,3.887,1.469"/>
<line fill="none" stroke="#000000" x1="33.898" y1="13.684" x2="39.956" y2="18.042"/>
</g>
<g id="Layer_5">
<path fill="#FFFFFF" stroke="#231F20" d="M71.84,25.366c2.924,4.479,3.033,9.591,0.242,11.415&#xD;&#xA;&#x9;&#x9;c-2.793,1.825-7.426-0.332-10.354-4.813c-2.933-4.48-3.037-9.589-0.244-11.415C64.275,18.73,68.913,20.884,71.84,25.366z"/>
<path fill="#231F20" d="M71.089,32.522c0,1.08-0.802,1.956-1.8,1.956c-0.993,0-1.803-0.877-1.803-1.956&#xD;&#xA;&#x9;&#x9;c0-1.08,0.81-1.958,1.803-1.958C70.287,30.564,71.089,31.442,71.089,32.522"/>
</g>
<g id="Layer_7">
<path fill="#FFFFFF" stroke="#231F20" d="M47.867,28.619c2.926,4.48,2.619,9.862-0.681,12.015&#xD;&#xA;&#x9;&#x9;c-3.302,2.159-8.351,0.272-11.276-4.208c-2.928-4.48-2.624-9.86,0.678-12.017C39.891,22.253,44.938,24.137,47.867,28.619z"/>
<path fill="#231F20" d="M46.079,34.507c0,1.081-0.803,1.957-1.801,1.957c-0.992,0-1.803-0.878-1.803-1.957&#xD;&#xA;&#x9;&#x9;c0-1.08,0.811-1.957,1.803-1.957C45.274,32.55,46.079,33.427,46.079,34.507"/>
</g>
<path fill="#5E4A42" stroke="#000000" d="M59.766,37.926c1.854,0,4.555-0.284,4.697,0.569c0.143,0.855-1.709,4.203-2.988,4.345&#xD;&#xA;&#x9;c-1.283,0.142-6.125-2.353-6.195-3.919C55.206,37.355,58.055,37.926,59.766,37.926z"/>
<g id="Layer_4">
<path fill="none" stroke="#231F20" stroke-width="1.2" d="M46.774,45.235c0,0,10.347,3.054,14.217,3.897&#xD;&#xA;&#x9;&#x9;c3.868,0.842,10.851,1.684,10.851,1.684s-7.99,10.245-17.328,7.644C45.176,55.863,45.345,49.975,46.774,45.235z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

Loaded 100 of 241 files, more files were not shown because too many files have changed in this diff. Show more