Skip to content

Commit

Permalink
release v0.9.1
Browse files Browse the repository at this point in the history
- Fix blocklydevtools.js delete shortcut causing severe project corruption
- Add my credits to top right
- Quick and easy compile button
- Remove defunc my stuff button
- Add tempvars extension
  • Loading branch information
ZXMushroom63 committed Jun 13, 2024
1 parent 99ebf2c commit 66719e9
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 82 deletions.
Binary file modified src/components/menu-bar/icon--profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
83 changes: 26 additions & 57 deletions src/components/menu-bar/menu-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -769,55 +769,40 @@ class MenuBar extends React.Component {
waitForUpdate
);
}}
content={"Compile"}
/* eslint-enable react/jsx-no-bind */
/>
)}
</ProjectWatcher>
)
) : this.props.showComingSoon ? (
<MenuBarItemTooltip id="share-button">
<ShareButton className={styles.menuBarButton} />
</MenuBarItemTooltip>
) : (
[]
)}
{this.props.canRemix ? remixButton : []}
</div>
<div
className={classNames(
styles.menuBarItem,
styles.communityButtonWrapper
)}
>
{this.props.enableCommunity ? (
(this.props.isShowingProject ||
this.props.isUpdating) && (
<ProjectWatcher
onDoneUpdating={this.props.onSeeCommunity}
>
{(waitForUpdate) => (
<CommunityButton
className={styles.menuBarButton}
/* eslint-disable react/jsx-no-bind */
onClick={() => {
this.handleClickSeeCommunity(
waitForUpdate
);
}}
/* eslint-enable react/jsx-no-bind */
/>
)}
</ProjectWatcher>
)
) : this.props.showComingSoon ? (
<MenuBarItemTooltip id="community-button">
<CommunityButton
<ShareButton
className={styles.menuBarButton}
content={
<SB3Downloader>
{(
className,
downloadProjectCallback,
downloadProjectOldCallback
) => (
<MenuItem
onClick={this.getSaveToComputerHandler(
downloadProjectOldCallback
)}
>
Compile
</MenuItem>
)}
</SB3Downloader>
}
isShared={this.props.isShared}
/>
</MenuBarItemTooltip>
) : (
[]
)}
{this.props.canRemix ? remixButton : []}
</div>
<Divider className={classNames(styles.divider)} />
<div className={styles.fileGroup}>
Expand Down Expand Up @@ -930,27 +915,17 @@ class MenuBar extends React.Component {
<React.Fragment>
{this.props.showComingSoon ? (
<React.Fragment>
<MenuBarItemTooltip id="mystuff">
<div
className={classNames(
styles.menuBarItem,
styles.hoverable,
styles.mystuffButton
)}
>
<img
className={styles.mystuffIcon}
src={mystuffIcon}
/>
</div>
</MenuBarItemTooltip>
<MenuBarItemTooltip
id="account-nav"

place={
this.props.isRtl ? "right" : "left"
}
>
<div
onClick={()=>{
window.open("https://scratch.mit.edu/users/ZXMushroom63/");
}}
className={classNames(
styles.menuBarItem,
styles.hoverable,
Expand All @@ -965,14 +940,8 @@ class MenuBar extends React.Component {
{new URLSearchParams(
window.location.search
).get("username") ||
"scratch-cat"}
"Made by ZXMushroom63"}
</span>
<img
className={
styles.dropdownCaretIcon
}
src={dropdownCaret}
/>
</div>
</MenuBarItemTooltip>
</React.Fragment>
Expand Down
37 changes: 13 additions & 24 deletions src/components/menu-bar/share-button.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import classNames from 'classnames';
import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react';
import Button from '../button/button.jsx';
import classNames from "classnames";
import { FormattedMessage } from "react-intl";
import PropTypes from "prop-types";
import React from "react";
import Button from "../button/button.jsx";
import styles from "./share-button.css";

import styles from './share-button.css';

const ShareButton = ({
className,
isShared,
onClick
}) => (
const ShareButton = ({ className, isShared, onClick, content }) => (
<Button
className={classNames(
className,
styles.shareButton,
{[styles.shareButtonIsShared]: isShared}
)}
className={classNames(className, styles.shareButton, {
[styles.shareButtonIsShared]: isShared,
})}
onClick={onClick}
>
{isShared ? (
Expand All @@ -26,23 +19,19 @@ const ShareButton = ({
id="gui.menuBar.isShared"
/>
) : (
<FormattedMessage
defaultMessage="Share"
description="Label for project share button"
id="gui.menuBar.share"
/>
content
)}
</Button>
);

ShareButton.propTypes = {
className: PropTypes.string,
isShared: PropTypes.bool,
onClick: PropTypes.func
onClick: PropTypes.func,
};

ShareButton.defaultProps = {
onClick: () => {}
onClick: () => {},
};

export default ShareButton;
22 changes: 22 additions & 0 deletions src/lib/libraries/extensions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import networkIconURL from './network/networkBig.png';
import impulseInsetIconURL from './impulse/impulse.svg';
import impulseIconURL from './impulse/impulseBig.png';

import tempvarsInsetIconURL from './tempvars/tempvars.svg';
import tempvarsIconURL from './tempvars/tempvarsBig.png';

import musicIconURL from './music/music.png';
import musicInsetIconURL from './music/music-small.svg';

Expand Down Expand Up @@ -53,6 +56,25 @@ import gdxforConnectionIconURL from './gdxfor/gdxfor-illustration.svg';
import gdxforConnectionSmallIconURL from './gdxfor/gdxfor-small.svg';

export default [
{
name: (
<FormattedMessage
defaultMessage="Temp Vars"
description="Name for the 'Temp Vars' extension"
id="gui.extension.tempvars.name"
/>
),
extensionId: 'tempvars',
iconURL: tempvarsIconURL,
insetIconURL: tempvarsInsetIconURL,
description:
<span>
Use temporary variables in code!<br></br>
<sub style={{lineHeight: "0 !important"}}></sub>
</span>
,
featured: true
},
{
name: (
<FormattedMessage
Expand Down
6 changes: 6 additions & 0 deletions src/lib/libraries/extensions/tempvars/tempvars.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/playground/userscripts/blocklydevtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,10 @@ module.exports = {
event.preventDefault();
if (element.hasAttribute("data-id")) {
blockId = element.getAttribute("data-id");
workspace.getBlockById(blockId).dispose(false); //dispose(false) means "do not heal stack"
var block = workspace.getBlockById(blockId);
block.getDescendants(false, true).forEach((block) => {
block.dispose(true); //Healing the stack is a good idea, previously I was not doing this and it was corrupting everything yay :]
});
if (workspace.getToolbox() //If the blockly instance has a toolbox, it needs to be refreshed,
) {
workspace.getToolbox().refreshSelection();
Expand Down

0 comments on commit 66719e9

Please sign in to comment.