Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyangliu committed Jun 20, 2024
2 parents 8bbbb8e + d0a468d commit 3f4b9c1
Show file tree
Hide file tree
Showing 20 changed files with 24,405 additions and 550 deletions.
24,573 changes: 24,187 additions & 386 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@
"lodash.omit": "4.5.0",
"lodash.throttle": "4.0.1",
"minilog": "3.1.0",
"monaco-editor": "^0.15.1",
"monaco-editor": "^0.20.0",
"omggif": "1.0.9",
"openblock-blocks": "0.1.0-prerelease.20240616014658",
"openblock-l10n": "^3.15.20240615153110",
"openblock-save-svg-as-png": "^1.4.18",
"openblock-vm": "^0.2.0-prerelease.20240618095638",
"openblock-vm": "^0.2.0-prerelease.20240620151653",
"papaparse": "5.3.0",
"postcss-import": "^12.0.0",
"postcss-loader": "^3.0.0",
"postcss-simple-vars": "^5.0.1",
"prop-types": "^15.5.10",
"query-string": "^5.1.1",
"raw-loader": "^0.5.1",
"react": "^16.14.0",
"react": "^16.0.0",
"react-contextmenu": "2.9.4",
"react-dom": "^16.14.0",
"react-dom": "^16.0.0",
"react-draggable": "3.0.5",
"react-ga4": "^2.1.0",
"react-intl": "2.9.0",
"react-modal": "3.6.1",
"react-monaco-editor": "^0.28.0",
"react-popover": "0.5.10",
"react-redux": "5.0.7",
"react-responsive": "5.0.0",
"react-responsive": "^4.1.0",
"react-scrollable-feed": "^1.3.2",
"react-style-proptype": "3.2.2",
"react-switch": "^5.0.1",
Expand Down
1 change: 1 addition & 0 deletions src/components/gui/gui.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}

.body-wrapper {
position: relative;
height: calc(100% - $menu-bar-height);
background-color: $ui-primary;
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,20 @@ const GUIComponent = props => {
/>
</Box>
</Box>
{(isRealtimeMode === false) ? (
<HardwareHeader
vm={vm}
/>) : null
}
{((isRealtimeMode === false) && (stageSizeMode !== STAGE_SIZE_MODES.hide)) ? (
<Hardware
vm={vm}
stageSize={stageSize}
/>) : null
}
</Box>
<DragLayer />
{(isRealtimeMode === false) ? (
<HardwareHeader
vm={vm}
stageSize={stageSize}
/>) : null
}
</Box>
</Box>
);
Expand Down
14 changes: 1 addition & 13 deletions src/components/hardware-header/hardware-header.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.hardware-header-wrapper {
position: absolute;
top: $menu-bar-height;
top: 0;
right: $space;
justify-content: space-between;

Expand All @@ -19,18 +19,6 @@
user-select: none;
}

.hardware-header-wrapper-stage-large {
width: 482px;
}

.hardware-header-wrapper-stage-small {
width: 242px;
}

.hardware-header-wrapper-stage-hide {
width: 242px;
}

.upload-group{
display: flex;
}
Expand Down
25 changes: 11 additions & 14 deletions src/components/hardware-header/hardware-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import Button from '../button/button.jsx';
import classNames from 'classnames';
import {defineMessages, FormattedMessage, intlShape} from 'react-intl';

import {STAGE_SIZE_MODES} from '../../lib/layout-constants';
import {STAGE_DISPLAY_SIZES} from '../../lib/layout-constants';
import {getStageDimensions} from '../../lib/screen-utils.js';

import styles from './hardware-header.css';

Expand Down Expand Up @@ -43,16 +44,16 @@ const HardwareHeaderComponent = props => {
onSetStageSmall,
onSetStageHide,
onUpload,
stageSizeMode
stageSize
} = props;
const stageDimensions = getStageDimensions(stageSize === STAGE_DISPLAY_SIZES.hide ?
STAGE_DISPLAY_SIZES.small : stageSize, null);
return (
<Box
className={classNames(
styles.hardwareHeaderWrapper,
stageSizeMode === STAGE_SIZE_MODES.large ? styles.hardwareHeaderWrapperStageLarge : null,
stageSizeMode === STAGE_SIZE_MODES.small ? styles.hardwareHeaderWrapperStageSmall : null,
stageSizeMode === STAGE_SIZE_MODES.hide ? styles.hardwareHeaderWrapperStageHide : null
styles.hardwareHeaderWrapper
)}
style={{width: stageDimensions.width + 2}}
>
<div className={styles.uploadGroup}>
<div
Expand Down Expand Up @@ -80,7 +81,7 @@ const HardwareHeaderComponent = props => {
className={classNames(
styles.stageButton,
styles.stageButtonFirst,
(stageSizeMode === STAGE_SIZE_MODES.small) ? null : styles.stageButtonToggledOff
(stageSize === STAGE_DISPLAY_SIZES.small) ? null : styles.stageButtonToggledOff
)}
onClick={onSetStageSmall}
>
Expand All @@ -97,7 +98,7 @@ const HardwareHeaderComponent = props => {
className={classNames(
styles.stageButton,
styles.stageButtonLast,
(stageSizeMode === STAGE_SIZE_MODES.large) ? null : styles.stageButtonToggledOff
(stageSize === STAGE_DISPLAY_SIZES.large) ? null : styles.stageButtonToggledOff
)}
onClick={onSetStageLarge}
>
Expand All @@ -115,7 +116,7 @@ const HardwareHeaderComponent = props => {
<Button
className={classNames(
styles.stageButton,
(stageSizeMode === STAGE_SIZE_MODES.hide) ? null : styles.stageButtonToggledOff
(stageSize === STAGE_DISPLAY_SIZES.hide) ? null : styles.stageButtonToggledOff
)}
onClick={onSetStageHide}
>
Expand All @@ -138,11 +139,7 @@ HardwareHeaderComponent.propTypes = {
onSetStageLarge: PropTypes.func.isRequired,
onSetStageSmall: PropTypes.func.isRequired,
onSetStageHide: PropTypes.func.isRequired,
stageSizeMode: PropTypes.oneOf(Object.keys(STAGE_SIZE_MODES))
};

HardwareHeaderComponent.defaultProps = {
stageSizeMode: STAGE_SIZE_MODES.large
stageSize: PropTypes.oneOf(Object.keys(STAGE_DISPLAY_SIZES)).isRequired
};

export default HardwareHeaderComponent;
8 changes: 0 additions & 8 deletions src/components/hardware/hardware.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
overflow: hidden;
}

.wide-wrapper {
width: calc(480px + 2px);
}

.narrow-wrapper {
width: calc(240px + 2px);
}

.button:hover {
cursor: pointer;
}
Expand Down
18 changes: 8 additions & 10 deletions src/components/hardware/hardware.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
import Box from '../box/box.jsx';
import classNames from 'classnames';

import {STAGE_SIZE_MODES} from '../../lib/layout-constants';
import {STAGE_DISPLAY_SIZES} from '../../lib/layout-constants.js';
import {getStageDimensions} from '../../lib/screen-utils.js';
import CodeEditor from '../../containers/code-editor.jsx';
import HardwareConsole from '../../containers/hardware-console.jsx';

Expand All @@ -23,8 +24,9 @@ const HardwareComponent = props => {
onCodeEditorDidMount,
onCodeEditorChange,
onClickCodeEditorLock,
stageSizeMode
stageSize
} = props;
const stageDimensions = getStageDimensions(stageSize, null);
return (
<Box className={styles.hardwareWrapper}>
<Box className={classNames(styles.codeEditorWrapper)}>
Expand All @@ -39,7 +41,7 @@ const HardwareComponent = props => {
/>
</button>
<CodeEditor
width={(stageSizeMode === STAGE_SIZE_MODES.large) ? 480 : 240}
width={stageDimensions.width}
value={codeEditorValue}
language={codeEditorLanguage}
editorWillMount={onCodeEditorWillMount}
Expand All @@ -50,8 +52,8 @@ const HardwareComponent = props => {
/>
</Box>
<Box
className={classNames(styles.hardwareConsoleWrapper,
(stageSizeMode === STAGE_SIZE_MODES.large) ? styles.wideWrapper : styles.narrowWrapper)}
className={classNames(styles.hardwareConsoleWrapper)}
style={{width: stageDimensions.width + 2}}
>
<HardwareConsole
{...props}
Expand Down Expand Up @@ -79,11 +81,7 @@ HardwareComponent.propTypes = {
onCodeEditorDidMount: PropTypes.func,
onCodeEditorChange: PropTypes.func,
onClickCodeEditorLock: PropTypes.func,
stageSizeMode: PropTypes.oneOf(Object.keys(STAGE_SIZE_MODES))
};

HardwareComponent.defaultProps = {
stageSizeMode: STAGE_SIZE_MODES.large
stageSize: PropTypes.oneOf(Object.keys(STAGE_DISPLAY_SIZES)).isRequired
};

export default HardwareComponent;
2 changes: 1 addition & 1 deletion src/components/library-item/library-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
white-space: normal;
min-width: 0;
color: $text-primary;
text-decoration:none;
Expand Down
1 change: 1 addition & 0 deletions src/components/menu-bar/icon--edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/menu-bar/icon--file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 27 additions & 21 deletions src/components/menu-bar/menu-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
padding: 0 0.75rem;
}

.main-menu span{
margin-left: 0.35rem;
}

.file-menu {
display: flex;
flex-direction: row;
Expand All @@ -70,7 +74,11 @@
padding: 0 0.75rem;
}

.scratch-logo {
.tail-menu span{
margin-left: 0.35rem;
}

.openblock-logo {
height: 1.6rem;
vertical-align: middle;
}
Expand All @@ -80,13 +88,12 @@
vertical-align: middle;
}

.scratch-logo.clickable {
.openblock-logo.clickable {
cursor: pointer;
}

.upload-firmware-logo {
height: 20px;
margin-right: 0.35rem;
vertical-align: middle;
}

Expand Down Expand Up @@ -139,6 +146,7 @@
.title-field-growable {
flex-grow: 1;
width: 2rem;
min-width: 6rem;
}

.menu-bar-item.language-menu {
Expand Down Expand Up @@ -193,7 +201,16 @@
}

.help-icon {
margin-right: 0.35rem;
height: 20px;
}

.file-icon {
height: 20px;
}

.edit-icon {
padding-top: 1px;
height: 20px;
}

.setting-icon {
Expand All @@ -203,17 +220,14 @@

.unconnected-icon {
width: 20px;
margin-right: 0.35rem;
}

.connected-icon {
height: 20px;
margin-right: 0.35rem;
}

.device-icon {
height: 20px;
margin-right: 0.35rem;
}

.save-icon {
Expand All @@ -222,17 +236,14 @@

.link-socket-icon {
height: 20px;
margin-right: 0.35rem;
}

.community-icon{
height: 20px;
margin-right: 0.35rem;
}

.wiki-icon{
height: 1.4rem;
margin-right: 0.35rem;
}

.account-nav-menu, .mystuff-button {
Expand Down Expand Up @@ -295,26 +306,21 @@
padding-left: 2rem;
}

.program-mode-group span{
margin-left: 0;
margin-right: 0.35rem;
}

.program-mode-switch {
vertical-align: middle;
}

.program-mode-switch .mode-switch-realtime {
.program-mode-switch .mode-switch-text {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
vertical-align: middle;
padding-right: 2rem;
white-space: nowrap;
}

.program-mode-switch .mode-switch-upload {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
vertical-align: middle;
padding-left: 2rem;
white-space: nowrap;
}
Loading

0 comments on commit 3f4b9c1

Please sign in to comment.