Skip to content

Commit 08a4d7a

Browse files
committed
Merge remote-tracking branch 'turbowarp/develop' into develop
2 parents ff3f209 + de8f5ae commit 08a4d7a

17 files changed

Lines changed: 14307 additions & 9346 deletions

‎package-lock.json‎

Lines changed: 13985 additions & 9166 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@turbowarp/jszip": "^3.11.1",
3737
"@turbowarp/nanolog": "^0.2.0",
3838
"@turbowarp/scratch-l10n": "^3.1001.0-202401241456-994097a5",
39-
"@turbowarp/scratch-storage": "^0.0.202403251715",
39+
"@turbowarp/scratch-storage": "^0.0.202502192258",
4040
"@turbowarp/scratch-svg-renderer": "^1.0.0-202312242305-12c360b",
4141
"@turbowarp/startaudiocontext": "^1.0.0",
4242
"arraybuffer-loader": "^1.0.6",
@@ -105,8 +105,8 @@
105105
"react-dom": "^16.0.0"
106106
},
107107
"devDependencies": {
108-
"@babel/cli": "7.14.8",
109-
"@babel/core": "7.14.8",
108+
"@babel/cli": "^7.26.4",
109+
"@babel/core": "^7.26.9",
110110
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
111111
"@babel/plugin-syntax-dynamic-import": "7.2.0",
112112
"@babel/plugin-transform-async-to-generator": "7.14.5",
@@ -127,7 +127,7 @@
127127
"file-loader": "6.2.0",
128128
"gh-pages": "3.2.3",
129129
"html-webpack-plugin": "^4.2.0",
130-
"jest": "21.2.1",
130+
"jest": "^29.7.0",
131131
"jest-junit": "7.0.0",
132132
"mkdirp": "1.0.3",
133133
"raf": "3.4.1",

‎src/addons/settings/translations.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,32 @@
171171
"title": "הגדרות תוסף",
172172
"unsupported": "חלק מהתוספות אינן נגישות בדפדפן שלך:"
173173
},
174+
"hu": {
175+
"addonFeedback": "Visszajelzés a kiegészítőkről",
176+
"confirmResetAll": "Biztos szeretnéd az összes kiegészítő-beállítást visszaállítani az alapértelmezett értékére?",
177+
"credits": "Stáblista:",
178+
"dirty": "A beállítások alkalmazásához töltsd újra az oldalakat.",
179+
"dirtyButton": "Újratöltés most",
180+
"enableDangerous": "Ez a kiegészítő veszélyes és szándékosan ELTÁVOLÍTHAT funkciókat. A legtöbb felhasználónak NEM érdemes bekapcsolnia ezt a kiegészítőt. Biztos, hogy bekapcsolod?",
181+
"export": "Beállítások exportálása",
182+
"groupDanger": "Veszélyes ({number})",
183+
"groupNew": "Új ({number})",
184+
"groupOthers": "Többi ({number})",
185+
"import": "Beállítások importálása",
186+
"noCompiler": "Ez a kiegészítő csak akkor működik, amikor a fordítóprogram ki van kapcsolva a Haladó -> Fordítóprogram kikapcsolása menüponttal vagy a \"Fordítóprogram kikapcsolása a szerkesztőben\" kiegészítővel.",
187+
"noResults": "Nincsenek találatok.",
188+
"presets": "Elmentett beállítások",
189+
"reset": "Visszaállítás",
190+
"resetAll": "Összes visszaállítása",
191+
"search": "Keresés",
192+
"tagBeta": "Béta",
193+
"tagDanger": "Veszélyes",
194+
"tagNew": "Új!",
195+
"tagRecommended": "Javasolt",
196+
"tagTheme": "Téma",
197+
"title": "Kiegészítő-beállítások",
198+
"unsupported": "Néhány kiegészítő nem érhető el ebben a böngészőben."
199+
},
174200
"it": {
175201
"addonFeedback": "Feedback sull'Addon",
176202
"confirmResetAll": "Sei sicuro di voler riportare tutte le impostazioni dell'addon al loro stato iniziale?",

‎src/components/browser-modal/browser-modal.css‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,26 @@
4747
.body {
4848
background: $ui-modal-background;
4949
padding: 1.5rem 2.25rem;
50-
text-align: center;
5150
display: flex;
5251
flex-direction: column;
5352
gap: 0.25rem;
5453
}
54+
55+
.title {
56+
text-align: center;
57+
}
58+
59+
.desktop-settings-outer {
60+
display: flex;
61+
justify-content: center;
62+
}
63+
64+
.desktop-settings-inner {
65+
font: inherit;
66+
font-weight: bold;
67+
padding: 0.75rem 1rem;
68+
border-radius: 0.25rem;
69+
border: 1px solid $ui-black-transparent;
70+
background-color: $looks-secondary;
71+
color: white;
72+
}

‎src/components/browser-modal/browser-modal.jsx‎

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,34 @@ import {
88
isNewFunctionSupported,
99
findIncompatibleUserscripts
1010
} from '../../lib/tw-environment-support-prober.js';
11+
import {APP_NAME} from '../../lib/brand.js';
1112

1213
import styles from './browser-modal.css';
1314
import unhappyBrowser from './unsupported-browser.svg';
1415

1516
const messages = defineMessages({
16-
label: {
17+
browserNotSupported: {
1718
id: 'gui.unsupportedBrowser.label',
1819
defaultMessage: 'Browser is not supported',
1920
description: ''
21+
},
22+
systemNotSupported: {
23+
id: 'tw.browserModal.desktopTitle',
24+
defaultMessage: 'System is not supported',
25+
description: 'Title of error message in desktop app when system does not support required API, such as WebGL'
2026
}
2127
});
2228

2329
const noop = () => {};
2430

2531
const BrowserModal = ({intl, ...props}) => {
26-
const label = messages.label;
32+
const title = props.onClickDesktopSettings ? messages.systemNotSupported : messages.browserNotSupported;
2733
const incompatibleUserscripts = findIncompatibleUserscripts();
2834
return (
2935
<ReactModal
3036
isOpen
3137
className={styles.modalContent}
32-
contentLabel={intl.formatMessage({...messages.label})}
38+
contentLabel={intl.formatMessage(title)}
3339
overlayClassName={styles.modalOverlay}
3440
onRequestClose={noop}
3541
>
@@ -42,8 +48,8 @@ const BrowserModal = ({intl, ...props}) => {
4248
</Box>
4349

4450
<Box className={styles.body}>
45-
<h2>
46-
<FormattedMessage {...label} />
51+
<h2 className={styles.title}>
52+
<FormattedMessage {...title} />
4753
</h2>
4854

4955
{/* eslint-disable max-len */}
@@ -68,49 +74,50 @@ const BrowserModal = ({intl, ...props}) => {
6874
<React.Fragment>
6975
<p>
7076
<FormattedMessage
71-
defaultMessage="Your browser {webGlLink} which is needed for this site to run. Try updating your browser and graphics drivers or restarting your computer."
72-
description="WebGL missing message. {webGLLink} is a link with the text 'does not support WebGL' from Scratch's translations"
73-
id="tw.webglModal.description"
77+
defaultMessage="{APP_NAME} requires WebGL, however your computer does not seem to support it. This is often a temporary error that can be fixed by restarting your computer."
78+
description="Error message when browser does not support WebGL."
79+
id="tw.browserModal.webgl1"
7480
values={{
75-
webGlLink: (
76-
<a href="https://get.webgl.org/">
77-
<FormattedMessage
78-
defaultMessage="does not support WebGL"
79-
description="link part of your browser does not support WebGL message"
80-
id="gui.webglModal.webgllink"
81-
/>
82-
</a>
83-
)
84-
}}
85-
/>
86-
</p>
87-
<p>
88-
<FormattedMessage
89-
defaultMessage="Make sure you're using a recent version of Google Chrome, Mozilla Firefox, Microsoft Edge, or Apple Safari."
90-
description="A message that appears in the browser not supported modal"
91-
id="tw.browserModal.desc"
92-
/>
93-
</p>
94-
<p>
95-
<FormattedMessage
96-
defaultMessage="On Apple devices, you must disable {lockdownMode}."
97-
description="Part of the browser not supported message. Lockdown Mode refers to https://support.apple.com/en-us/HT212650"
98-
id="tw.lockdownMode"
99-
values={{
100-
lockdownMode: (
101-
<a href="https://support.apple.com/en-us/HT212650">
102-
<FormattedMessage
103-
defaultMessage="Lockdown Mode"
104-
description="Links to an Apple support page about Lockdown Mode: https://support.apple.com/en-us/HT212650 Try to translate this the same as Apple."
105-
id="tw.lockdownMode2"
106-
/>
107-
</a>
108-
)
81+
APP_NAME
10982
}}
11083
/>
11184
</p>
85+
86+
{props.onClickDesktopSettings ? (
87+
<React.Fragment>
88+
<p>
89+
<FormattedMessage
90+
defaultMessage={'You can also try toggling the "graphics acceleration" option in desktop settings:'}
91+
description="Error message when browser does not support WebGL (desktop app version). Consider seeing how Chrome translates 'graphics acceleration' into your language."
92+
id="tw.browserModal.webglDesktop"
93+
/>
94+
</p>
95+
<div className={styles.desktopSettingsOuter}>
96+
<button
97+
onClick={props.onClickDesktopSettings}
98+
className={styles.desktopSettingsInner}
99+
>
100+
<FormattedMessage
101+
defaultMessage="Open Desktop Settings"
102+
description="Button in unsupported system modal to open desktop settings"
103+
id="tw.browserModal.desktopSettings"
104+
/>
105+
</button>
106+
</div>
107+
</React.Fragment>
108+
) : (
109+
<p>
110+
<FormattedMessage
111+
defaultMessage={'Use a recent version of Chrome, Firefox, or Safari, and ensure your graphics drivers are up to date. You can also try toggling the "graphics acceleration" or "hardware acceleration" option in your browser\'s settings.'}
112+
description="Error message when browser does not support WebGL (browser version). Chrome calls it graphics acceleration and Firefox calls it hardware acceleration; consider seeing how they actually translate these"
113+
id="tw.browserModal.webglBrowser"
114+
/>
115+
</p>
116+
)}
112117
</React.Fragment>
113118
)}
119+
120+
{/* eslint-enable max-len */}
114121
</Box>
115122
</div>
116123
</ReactModal>
@@ -119,7 +126,8 @@ const BrowserModal = ({intl, ...props}) => {
119126

120127
BrowserModal.propTypes = {
121128
intl: intlShape.isRequired,
122-
isRtl: PropTypes.bool
129+
isRtl: PropTypes.bool,
130+
onClickDesktopSettings: PropTypes.func
123131
};
124132

125133
const WrappedBrowserModal = injectIntl(BrowserModal);

‎src/components/gui/gui.jsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ const GUIComponent = props => {
255255
/>
256256
) : null}
257257
{isBrowserSupported() ? null : (
258-
<BrowserModal isRtl={isRtl} />
258+
<BrowserModal
259+
isRtl={isRtl}
260+
onClickDesktopSettings={onClickDesktopSettings}
261+
/>
259262
)}
260263
{tipsLibraryVisible ? (
261264
<TipsLibrary />

‎src/components/menu-bar/menu-bar.jsx‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,15 @@ class MenuBar extends React.Component {
337337
}
338338
handleKeyPress(event) {
339339
const modifier = bowser.mac ? event.metaKey : event.ctrlKey;
340-
if (modifier && event.key.toLowerCase() === 's') {
341-
if(this.props.canSave){
340+
if (modifier) {
341+
if (event.key.toLowerCase() === 's') {
342+
if(this.props.canSave){
342343
this.props.onClickSave();
343-
event.preventDefault();
344+
event.preventDefault();
345+
}
346+
} else if (event.key.toLowerCase() === 'o') {
347+
event.preventDefault();
348+
this.props.onStartSelectingFileUpload();
344349
}
345350
}
346351
}
@@ -549,7 +554,10 @@ class MenuBar extends React.Component {
549554
this.handleClickDesktopSettings
550555
}
551556
// eslint-disable-next-line react/jsx-no-bind
552-
onOpenCustomSettings={this.props.onClickAddonSettings.bind(null, 'editor-theme3')}
557+
onOpenCustomSettings={
558+
this.props.onClickAddonSettings &&
559+
this.props.onClickAddonSettings.bind(null, 'editor-theme3')
560+
}
553561
onRequestClose={this.props.onRequestCloseSettings}
554562
onRequestOpen={this.props.onClickSettings}
555563
settingsMenuOpen={this.props.settingsMenuOpen}

‎src/components/menu-bar/tw-theme-blocks.jsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ const BlocksThemeMenu = ({
120120
/>
121121
</div>
122122
<Submenu place={isRtl ? 'left' : 'right'}>
123-
{[BLOCKS_THREE, BLOCKS_HIGH_CONTRAST, BLOCKS_DARK, BLOCKS_CUSTOM].map(i => (
123+
{[
124+
BLOCKS_THREE,
125+
BLOCKS_HIGH_CONTRAST,
126+
BLOCKS_DARK,
127+
...(onOpenCustomSettings ? [BLOCKS_CUSTOM] : [])
128+
].map(i => (
124129
<ThemeMenuItem
125130
key={i}
126131
id={i}

‎src/containers/extension-library.jsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const fetchLibrary = async () => {
5858
iconURL: APP_DOMAIN +`/extensions/${extension.image || 'images/unknown.svg'}`,
5959
tags: ['tw'],
6060
credits: [
61-
...(extension.by || []),
62-
...(extension.original || [])
61+
...(extension.original || []),
62+
...(extension.by || [])
6363
].map(credit => {
6464
if (credit.link) {
6565
return (
@@ -80,7 +80,7 @@ const fetchLibrary = async () => {
8080
href: `${process.env.ROOT}editor?project_url=https://extensions.turbowarp.org/samples/${encodeURIComponent(sample)}.sb3`,
8181
text: sample
8282
})) : null,
83-
incompatibleWithScratch: true,
83+
incompatibleWithScratch: !extension.scratchCompatible,
8484
featured: true
8585
}));
8686
};

‎src/containers/sb3-downloader.jsx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,18 @@ class SB3Downloader extends React.Component {
9797
return;
9898
}
9999
try {
100-
const handle = await FileSystemAPI.showSaveFilePicker(this.props.projectFilename);
100+
const handle = await this.props.showSaveFilePicker({
101+
suggestedName: this.props.projectFilename,
102+
types: [
103+
{
104+
description: 'Scratch 3 Project',
105+
accept: {
106+
'application/octet-stream': '.sb3'
107+
}
108+
}
109+
],
110+
excludeAcceptAllOption: true
111+
});
101112
await this.saveToHandle(handle);
102113
this.props.onSetFileHandle(handle);
103114
const title = getProjectTitleFromFilename(handle.name);

0 commit comments

Comments
 (0)