Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyangliu committed Dec 17, 2024
2 parents cd7be30 + 5514f7c commit 66ec510
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 1,459 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OpenBlock Online: [https://openblockcc.github.io/openblock-gui/develop/](https:/

## Getting Start

Visit the wiki: [https://openblockcc.github.io](https://openblockcc.github.io)
Visit the wiki: [https://wiki.openblock.cc](https://wiki.openblock.cc)

## Join chat

Expand Down
1,768 changes: 339 additions & 1,429 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "./dist/scratch-gui.js",
"scripts": {
"build": "npm run clean && webpack --colors --bail",
"clean": "rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
"clean": "rimraf ./build && mkdirp build",
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1) [skip ci]\"",
"prune": "./prune-gh-pages.sh",
"i18n:push": "tx-push-src openblock-editor interface translations/en.json",
Expand Down Expand Up @@ -56,10 +56,10 @@
"minilog": "3.1.0",
"monaco-editor": "^0.20.0",
"omggif": "1.0.9",
"openblock-blocks": "^0.1.0-prerelease.20240624113036",
"openblock-blocks": "^0.1.0-prerelease.20240708020710",
"openblock-l10n": "^3.15.20240704111820",
"openblock-save-svg-as-png": "^1.4.18",
"openblock-vm": "^0.2.0-prerelease.20240701022057",
"openblock-vm": "^0.2.0-prerelease.20241214115520",
"papaparse": "5.3.0",
"postcss-import": "^12.0.0",
"postcss-loader": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ const GUIComponent = props => {
}}
stageSize={stageSize}
vm={vm}
onShowMessageBox={onShowMessageBox}
/>
</Box>
<Box className={styles.extensionButtonContainer}>
Expand Down
12 changes: 6 additions & 6 deletions src/components/menu-bar/menu-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ import collectMetadata from '../../lib/collect-metadata';
import styles from './menu-bar.css';

import helpIcon from '../../lib/assets/icon--tutorials.svg';
import mystuffIcon from './icon--mystuff.png'; // eslint-disable-line no-unused-vars
import profileIcon from './icon--profile.png'; // eslint-disable-line no-unused-vars
// import mystuffIcon from './icon--mystuff.png';
// import profileIcon from './icon--profile.png';
import remixIcon from './icon--remix.svg';
import dropdownCaret from './dropdown-caret.svg';
import languageIcon from '../language-selector/language-icon.svg';
import aboutIcon from './icon--about.svg';
import saveIcon from './icon--save.svg';
import linkSocketIcon from './icon--link-socket.svg'; // eslint-disable-line no-unused-vars
import communityIcon from './icon--community.svg';
// import linkSocketIcon from './icon--link-socket.svg';
// import communityIcon from './icon--community.svg';
import wikiIcon from './icon--wiki.svg';
import fileIcon from './icon--file.svg';
import editIcon from './icon--edit.svg';
Expand Down Expand Up @@ -811,7 +811,7 @@ class MenuBar extends React.Component {
)}
</div>)}
<div className={styles.tailMenu}>
<div
{/* <div
aria-label={this.props.intl.formatMessage(ariaMessages.community)}
className={classNames(styles.menuBarItem, styles.hoverable)}
onClick={this.handleClickOpenCommunity}
Expand All @@ -821,7 +821,7 @@ class MenuBar extends React.Component {
src={communityIcon}
/>
{this.state.isOverflow ? null : <FormattedMessage {...ariaMessages.community} />}
</div>
</div>*/}
<div
aria-label={this.props.intl.formatMessage(ariaMessages.wiki)}
className={classNames(styles.menuBarItem, styles.hoverable)}
Expand Down
3 changes: 3 additions & 0 deletions src/components/stage-header/stage-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const StageHeaderComponent = function (props) {
className={styles.signalIcon}
draggable={false}
src={signalIcon}
hidden={!props.deviceId}
/>
</Box>
<div className={styles.stageSizeRow}>
Expand Down Expand Up @@ -191,12 +192,14 @@ const StageHeaderComponent = function (props) {
};

const mapStateToProps = state => ({
deviceId: state.scratchGui.device.deviceId,
realtimeConnection: state.scratchGui.connectionModal.realtimeConnection,
// This is the button's mode, as opposed to the actual current state
stageSizeMode: state.scratchGui.stageSize.stageSize
});

StageHeaderComponent.propTypes = {
deviceId: PropTypes.string,
intl: intlShape,
isFullScreen: PropTypes.bool.isRequired,
isPlayerOnly: PropTypes.bool.isRequired,
Expand Down
5 changes: 5 additions & 0 deletions src/containers/blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import VMScratchBlocks from '../lib/blocks';
import VM from 'openblock-vm';
import MessageBoxType from '../lib/message-box.js';

import log from '../lib/log.js';
import Prompt from './prompt.jsx';
Expand Down Expand Up @@ -93,6 +94,9 @@ class Blocks extends React.Component {
this.ScratchBlocks.prompt = this.handlePromptStart;
this.ScratchBlocks.statusButtonCallback = this.handleConnectionModalStart;
this.ScratchBlocks.recordSoundCallback = this.handleOpenSoundRecorder;
this.ScratchBlocks.alert = message => {
this.props.onShowMessageBox(MessageBoxType.alert, message);
};

this.state = {
prompt: null
Expand Down Expand Up @@ -842,6 +846,7 @@ Blocks.propTypes = {
onSetBaudrate: PropTypes.func.isRequired,
onSetCodeEditorValue: PropTypes.func,
onSetSupportSwitchMode: PropTypes.func,
onShowMessageBox: PropTypes.func.isRequired,
stageSize: PropTypes.oneOf(Object.keys(STAGE_DISPLAY_SIZES)).isRequired,
toolboxXML: PropTypes.string,
updateMetrics: PropTypes.func,
Expand Down
42 changes: 22 additions & 20 deletions src/lib/make-toolbox-xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ const events = function (isInitialSetup, isStage) {
`;
};

const control = function (isInitialSetup, isStage) {
const control = function (isInitialSetup, isStage, targetId, isRealtimeMode) {
return `
<category name="%{BKY_CATEGORY_CONTROL}" id="control" colour="#FFAB19" secondaryColour="#CF8B17">
<block type="control_wait">
Expand All @@ -409,24 +409,26 @@ const control = function (isInitialSetup, isStage) {
<block id="wait_until" type="control_wait_until"/>
<block id="repeat_until" type="control_repeat_until"/>
${blockSeparator}
<block type="control_stop"/>
${blockSeparator}
${isStage ? `
<block type="control_create_clone_of">
<value name="CLONE_OPTION">
<shadow type="control_create_clone_of_menu"/>
</value>
</block>
` : `
<block type="control_start_as_clone"/>
<block type="control_create_clone_of">
<value name="CLONE_OPTION">
<shadow type="control_create_clone_of_menu"/>
</value>
</block>
<block type="control_delete_this_clone"/>
`}
${categorySeparator}
${isRealtimeMode ? `
<block type="control_stop"/>
${blockSeparator}
${isStage ? `
<block type="control_create_clone_of">
<value name="CLONE_OPTION">
<shadow type="control_create_clone_of_menu"/>
</value>
</block>
` : `
<block type="control_start_as_clone"/>
<block type="control_create_clone_of">
<value name="CLONE_OPTION">
<shadow type="control_create_clone_of_menu"/>
</value>
</block>
<block type="control_delete_this_clone"/>
`}
${categorySeparator}
` : null}
</category>
`;
};
Expand Down Expand Up @@ -765,7 +767,7 @@ const makeToolboxXML = function (isInitialSetup, device = null, isStage = true,
const looksXML = moveCategory('looks') || looks(isInitialSetup, isStage, targetId, costumeName, backdropName);
const soundXML = moveCategory('sound') || sound(isInitialSetup, isStage, targetId, soundName);
let eventsXML = moveCategory('event') || events(isInitialSetup, isStage, targetId);
const controlXML = moveCategory('control') || control(isInitialSetup, isStage, targetId);
const controlXML = moveCategory('control') || control(isInitialSetup, isStage, targetId, isRealtimeMode);
const sensingXML = moveCategory('sensing') || sensing(isInitialSetup, isStage, targetId);
const operatorsXML = moveCategory('operators') || operators(isInitialSetup, isStage, targetId);
const variablesXML = moveCategory('data') || variables(isInitialSetup, isStage, targetId);
Expand Down

0 comments on commit 66ec510

Please sign in to comment.