Skip to content

Commit de9f4c9

Browse files
authored
Merge pull request #1 from TurboWarp/develop
merge with parent
2 parents 4be60c6 + 28a1ca2 commit de9f4c9

19 files changed

Lines changed: 508 additions & 58 deletions

File tree

‎.github/workflows/node.js.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
13+
with:
14+
persist-credentials: false
1315
- name: Install Node.js
14-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
1517
with:
1618
node-version: 20
1719
cache: npm

‎package-lock.json‎

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

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
},
3434
"dependencies": {
3535
"@microbit/microbit-universal-hex": "0.2.2",
36+
"@turbowarp/jszip": "^3.11.1",
3637
"@turbowarp/nanolog": "^0.2.0",
3738
"@turbowarp/scratch-l10n": "^3.1001.0-202401241456-994097a5",
3839
"@turbowarp/scratch-storage": "^0.0.202403251715",

‎src/addons/addons/debugger/module.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ export const setPaused = (_paused) => {
101101
if (didChange) {
102102
paused = _paused;
103103
eventTarget.dispatchEvent(new CustomEvent("change"));
104+
105+
// TW: events for extensions
106+
if (paused) {
107+
vm.runtime.emit("RUNTIME_PAUSED");
108+
} else {
109+
vm.runtime.emit("RUNTIME_UNPAUSED");
110+
}
104111
}
105112

106113
// Don't check didChange as new threads could've started that we need to pause.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"commit":"0d357b5"}
1+
{"commit":"c237cfa"}

‎src/components/sound-editor/sound-editor.jsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ const SoundEditor = props => (
361361
{formatDuration(props.playhead, props.trimStart, props.trimEnd, props.duration)}
362362
</div>
363363
<div className={styles.advancedInfo}>
364-
{props.sampleRate}
365-
{'Hz '}
366364
{props.isStereo ? (
367365
<FormattedMessage
368366
defaultMessage="Stereo"
@@ -405,7 +403,6 @@ SoundEditor.propTypes = {
405403
isStereo: PropTypes.bool.isRequired,
406404
duration: PropTypes.number.isRequired,
407405
size: PropTypes.number.isRequired,
408-
sampleRate: PropTypes.number.isRequired,
409406
canPaste: PropTypes.bool.isRequired,
410407
canRedo: PropTypes.bool.isRequired,
411408
canUndo: PropTypes.bool.isRequired,
Lines changed: 2 additions & 0 deletions
Loading

‎src/components/tw-restore-point-modal/restore-point-modal.css‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import "../../css/filters.css";
33

44
.modal-content {
5-
max-width: 550px;
5+
max-width: 600px;
66
margin-top: 50px;
77
}
88

@@ -96,25 +96,34 @@
9696
font-size: 2em;
9797
}
9898

99-
.delete-button {
99+
.restore-point-buttons {
100+
margin-left: auto;
101+
display: flex;
102+
flex-direction: row;
103+
gap: 0.5rem;
104+
}
105+
106+
.restore-point-button {
100107
appearance: none;
101108
background: none;
102109
border: none;
103110
border-radius: 100%;
104111
width: 2rem;
105112
height: 2rem;
106-
margin-left: auto;
107113
display: flex;
108114
align-items: center;
109115
justify-content: center;
110116
}
111-
.delete-button img {
117+
.restore-point-button[disabled] {
118+
opacity: 0.5;
119+
}
120+
.restore-point-button img {
112121
display: block;
113122
width: 75%;
114123
height: 75%;
115124
filter: $filter-icon-gray;
116125
}
117-
.delete-button:hover {
126+
.restore-point-button:not([disabled]):hover {
118127
background-color: $ui-black-transparent;
119128
}
120129

‎src/components/tw-restore-point-modal/restore-point-modal.jsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ const RestorePointModal = props => (
166166
<RestorePoint
167167
key={restorePoint.id}
168168
onClickDelete={props.onClickDelete}
169+
onClickExport={props.onClickExport}
169170
onClickLoad={props.onClickLoad}
171+
isExporting={props.isExporting(restorePoint.id)}
170172
{...restorePoint}
171173
/>
172174
))}
@@ -221,7 +223,9 @@ RestorePointModal.propTypes = {
221223
onClickCreate: PropTypes.func.isRequired,
222224
onClickDelete: PropTypes.func.isRequired,
223225
onClickDeleteAll: PropTypes.func.isRequired,
226+
onClickExport: PropTypes.func.isRequired,
224227
onClickLoad: PropTypes.func.isRequired,
228+
isExporting: PropTypes.func.isRequired,
225229
isLoading: PropTypes.bool.isRequired,
226230
totalSize: PropTypes.number.isRequired,
227231
restorePoints: PropTypes.arrayOf(PropTypes.shape({})),

‎src/components/tw-restore-point-modal/restore-point.jsx‎

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import styles from './restore-point-modal.css';
66
import {formatBytes} from '../../lib/tw-bytes-utils';
77
import RestorePointAPI from '../../lib/tw-restore-point-api';
88
import log from '../../lib/log';
9+
import exportIcon from './export.svg';
910
import deleteIcon from './delete.svg';
1011

1112
// Browser support is not perfect yet
@@ -16,6 +17,7 @@ class RestorePoint extends React.Component {
1617
super(props);
1718
bindAll(this, [
1819
'handleClickDelete',
20+
'handleClickExport',
1921
'handleClickLoad'
2022
]);
2123
this.state = {
@@ -69,6 +71,11 @@ class RestorePoint extends React.Component {
6971
this.props.onClickDelete(this.props.id);
7072
}
7173

74+
handleClickExport (e) {
75+
e.stopPropagation();
76+
this.props.onClickExport(this.props.id);
77+
}
78+
7279
handleClickLoad () {
7380
this.props.onClickLoad(this.props.id);
7481
}
@@ -129,16 +136,31 @@ class RestorePoint extends React.Component {
129136
</div>
130137
</div>
131138

132-
<button
133-
className={styles.deleteButton}
134-
onClick={this.handleClickDelete}
135-
>
136-
<img
137-
src={deleteIcon}
138-
alt="Delete"
139-
draggable={false}
140-
/>
141-
</button>
139+
<div className={styles.restorePointButtons}>
140+
<button
141+
className={styles.restorePointButton}
142+
onClick={this.handleClickExport}
143+
disabled={this.props.isExporting}
144+
>
145+
<img
146+
src={exportIcon}
147+
alt="Export"
148+
draggable={false}
149+
/>
150+
</button>
151+
152+
<button
153+
className={styles.restorePointButton}
154+
onClick={this.handleClickDelete}
155+
disabled={this.props.isExporting}
156+
>
157+
<img
158+
src={deleteIcon}
159+
alt="Delete"
160+
draggable={false}
161+
/>
162+
</button>
163+
</div>
142164
</div>
143165
);
144166
}
@@ -151,7 +173,9 @@ RestorePoint.propTypes = {
151173
projectSize: PropTypes.number.isRequired,
152174
thumbnailSize: PropTypes.number.isRequired,
153175
assets: PropTypes.shape({}).isRequired, // Record<string, number>
176+
isExporting: PropTypes.bool.isRequired,
154177
onClickDelete: PropTypes.func.isRequired,
178+
onClickExport: PropTypes.func.isRequired,
155179
onClickLoad: PropTypes.func.isRequired
156180
};
157181

0 commit comments

Comments
 (0)