Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ before_install:
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
install:
- npm --production=false install
- (cd node_modules/scratch-vm && npm --production=false install && $(npm bin)/webpack --colors --bail --silent)
script:
- npm run test:lint
- npm run test:unit
Expand Down
292 changes: 80 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"scratch-render": "0.1.0-prerelease.20200228152431",
"scratch-storage": "1.3.2",
"scratch-svg-renderer": "0.2.0-prerelease.20200205003400",
"scratch-vm": "0.2.0-prerelease.20200227204654",
"selenium-webdriver": "3.6.0",
"shelljs": "^0.8.3",
"startaudiocontext": "1.2.1",
Expand Down Expand Up @@ -150,6 +149,7 @@
}
},
"dependencies": {
"lodash.camelcase": "^4.3.0"
"lodash.camelcase": "^4.3.0",
"scratch-vm": "github:smalruby/scratch-vm#mesh_extension"
}
}
4 changes: 2 additions & 2 deletions src/components/alerts/alert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const AlertComponent = ({
id="gui.alerts.lostPeripheralConnection"
values={{
extensionName: (
`${extensionName}`
extensionName
)
}}
/>
Expand Down Expand Up @@ -120,7 +120,7 @@ const AlertComponent = ({
AlertComponent.propTypes = {
closeButton: PropTypes.bool,
content: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
extensionName: PropTypes.string,
extensionName: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
iconSpinner: PropTypes.bool,
iconURL: PropTypes.string,
level: PropTypes.string,
Expand Down
24 changes: 15 additions & 9 deletions src/components/connection-modal/connected-step.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@ const ConnectedStep = props => (
className={styles.peripheralActivityIcon}
src={props.connectionIconURL}
/>
<img
className={styles.bluetoothConnectedIcon}
src={bluetoothIcon}
/>
{props.extensionId !== 'mesh' && (
<img
className={styles.bluetoothConnectedIcon}
src={bluetoothIcon}
/>
)}
</div>
</Box>
</Box>
<Box className={styles.bottomArea}>
<Box className={classNames(styles.bottomAreaItem, styles.instructions)}>
<FormattedMessage
defaultMessage="Connected"
description="Message indicating that a device was connected"
id="gui.connection.connected"
/>
{props.connectedMessage || (
<FormattedMessage
defaultMessage="Connected"
description="Message indicating that a device was connected"
id="gui.connection.connected"
/>
)}
</Box>
<Dots
success
Expand Down Expand Up @@ -64,7 +68,9 @@ const ConnectedStep = props => (
);

ConnectedStep.propTypes = {
connectedMessage: PropTypes.string,
connectionIconURL: PropTypes.string.isRequired,
extensionId: PropTypes.string.isRequired,
onCancel: PropTypes.func,
onDisconnect: PropTypes.func
};
Expand Down
11 changes: 7 additions & 4 deletions src/components/connection-modal/connecting-step.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ const ConnectingStep = props => (
className={styles.peripheralActivityIcon}
src={props.connectionIconURL}
/>
<img
className={styles.bluetoothConnectingIcon}
src={bluetoothIcon}
/>
{props.extensionId !== 'mesh' && (
<img
className={styles.bluetoothConnectingIcon}
src={bluetoothIcon}
/>
)}
</div>
</Box>
</Box>
Expand Down Expand Up @@ -64,6 +66,7 @@ const ConnectingStep = props => (
ConnectingStep.propTypes = {
connectingMessage: PropTypes.node.isRequired,
connectionIconURL: PropTypes.string.isRequired,
extensionId: PropTypes.string.isRequired,
onDisconnect: PropTypes.func
};

Expand Down
2 changes: 2 additions & 0 deletions src/components/connection-modal/connection-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ const ConnectionModalComponent = props => (
);

ConnectionModalComponent.propTypes = {
connectedMessage: PropTypes.string,
connectingMessage: PropTypes.node.isRequired,
connectionSmallIconURL: PropTypes.string,
connectionTipIconURL: PropTypes.string,
extensionId: PropTypes.string.isRequired,
name: PropTypes.node,
onCancel: PropTypes.func.isRequired,
onHelp: PropTypes.func.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ModalComponent = props => (
className={classNames(styles.modalContent, props.className, {
[styles.fullScreen]: props.fullScreen
})}
contentLabel={props.contentLabel}
contentLabel={props.contentLabel.toString()}
overlayClassName={styles.modalOverlay}
onRequestClose={props.onRequestClose}
>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/alert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Alert.propTypes = {
closeButton: PropTypes.bool,
content: PropTypes.element,
extensionId: PropTypes.string,
extensionName: PropTypes.string,
extensionName: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
iconSpinner: PropTypes.bool,
iconURL: PropTypes.string,
index: PropTypes.number,
Expand Down
7 changes: 5 additions & 2 deletions src/containers/connection-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class ConnectionModal extends React.Component {
this.state = {
extension: extensionData.find(ext => ext.extensionId === props.extensionId),
phase: props.vm.getPeripheralIsConnected(props.extensionId) ?
PHASES.connected : PHASES.scanning
PHASES.connected : PHASES.scanning,
connectedMessage: props.vm.getPeripheralConnectedMessage(props.extensionId)
};
}
componentDidMount () {
Expand Down Expand Up @@ -88,7 +89,8 @@ class ConnectionModal extends React.Component {
}
handleConnected () {
this.setState({
phase: PHASES.connected
phase: PHASES.connected,
connectedMessage: this.props.vm.getPeripheralConnectedMessage(this.props.extensionId)
});
analytics.event({
category: 'extensions',
Expand All @@ -114,6 +116,7 @@ class ConnectionModal extends React.Component {
extensionId={this.props.extensionId}
name={this.state.extension && this.state.extension.name}
phase={this.state.phase}
connectedMessage={this.state.connectedMessage}
title={this.props.extensionId}
useAutoScan={this.state.extension && this.state.extension.useAutoScan}
vm={this.props.vm}
Expand Down
150 changes: 0 additions & 150 deletions src/lib/apply-scratch-vm-patch.js

This file was deleted.

39 changes: 39 additions & 0 deletions src/lib/libraries/extensions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ import gdxforInsetIconURL from './gdxfor/gdxfor-small.svg';
import gdxforConnectionIconURL from './gdxfor/gdxfor-illustration.svg';
import gdxforConnectionSmallIconURL from './gdxfor/gdxfor-small.svg';

import meshIconURL from './mesh/mesh.png';
import meshInsetIconURL from './mesh/mesh-small.png';
import meshConnectionIconURL from './mesh/mesh-illustration.png';
import meshConnectionSmallIconURL from './mesh/mesh-small.png';

export default [
{
name: (
Expand Down Expand Up @@ -317,5 +322,39 @@ export default [
/>
),
helpLink: 'https://scratch.mit.edu/vernier'
},
{
name: (
<FormattedMessage
defaultMessage="Mesh"
description="Name for the 'Mesh' extension"
id="gui.smalruby3.extension.mesh.name"
/>
),
extensionId: 'mesh',
iconURL: meshIconURL,
insetIconURL: meshInsetIconURL,
description: (
<FormattedMessage
defaultMessage="Allowing users to interact over a computer network."
description="Description for the 'Mesh' extension"
id="gui.smalruby3.extension.mesh.description"
/>
),
featured: true,
bluetoothRequired: false,
internetConnectionRequired: true,
launchPeripheralConnectionFlow: true,
useAutoScan: false,
connectionIconURL: meshConnectionIconURL,
connectionSmallIconURL: meshConnectionSmallIconURL,
connectingMessage: (
<FormattedMessage
defaultMessage="Connecting"
description="Message to help people connect to Mesh network."
id="gui.smalruby3.extension.mesh.connectingMessage"
/>
),
helpLink: 'https://github.com/smalruby/smalruby3-gui/wiki/Mesh'
}
];
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/libraries/extensions/mesh/mesh-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/libraries/extensions/mesh/mesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/lib/ruby-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import BoostBlocks from './boost.js';
import EV3Blocks from './ev3.js';
import WeDo2Blocks from './wedo2.js';
import GdxForBlocks from './gdx_for.js';
import MeshBlocks from './mesh.js';

const SCALAR_TYPE = '';
const LIST_TYPE = 'list';
Expand Down Expand Up @@ -434,7 +435,6 @@ RubyGenerator.getScripts = function () {
MathBlocks(RubyGenerator);
TextBlocks(RubyGenerator);
ColourBlocks(RubyGenerator);

MotionBlocks(RubyGenerator);
LooksBlocks(RubyGenerator);
SoundBlocks(RubyGenerator);
Expand All @@ -456,5 +456,6 @@ BoostBlocks(RubyGenerator);
EV3Blocks(RubyGenerator);
WeDo2Blocks(RubyGenerator);
GdxForBlocks(RubyGenerator);
MeshBlocks(RubyGenerator);

export default RubyGenerator;
Loading