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
37 changes: 37 additions & 0 deletions packages/scratch-gui/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Google Drive API Configuration
# See docs/google-drive-setup.md for setup instructions

# Google OAuth 2.0 Client ID (Web Application)
# Example: 123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com
GOOGLE_CLIENT_ID=your-client-id-here.apps.googleusercontent.com

# Google API Key (for Picker API)
# Example: AIzaSyAbCdEfGhIjKlMnOpQrStUvWxYz1234567
GOOGLE_API_KEY=your-api-key-here

# Mesh V2 Extension Configuration
# See https://github.com/smalruby/scratch-vm/tree/develop/ for backend setup

# AppSync GraphQL API Endpoint (Production)
# Example: https://xxxxx.appsync-api.ap-northeast-1.amazonaws.com/graphql
MESH_GRAPHQL_ENDPOINT=https://example.appsync-api.ap-northeast-1.amazonaws.com/graphql

# AppSync API Key (Production)
# Example: da2-xxxxx
MESH_API_KEY=da2-your-api-key

# AWS Region (Production)
# Example: ap-northeast-1
MESH_AWS_REGION=ap-northeast-1

# Data update interval in milliseconds
# Default: 1000
MESH_DATA_UPDATE_INTERVAL_MS=1000

# Event batch interval in milliseconds
# Default: 1000
MESH_EVENT_BATCH_INTERVAL_MS=1000

# Periodic data sync interval in milliseconds
# Default: 15000 (15 seconds)
MESH_PERIODIC_DATA_SYNC_INTERVAL_MS=15000
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const ConnectionModalComponent = props => {
);
return (<Modal
className={styles.modalContent}
contentLabel={props.name}
contentLabel={typeof props.name === 'string' ? props.name : props.title}
headerTitle={props.name}
headerClassName={styles.header}
headerImage={props.connectionSmallIconURL}
id="connectionModal"
Expand Down
3 changes: 2 additions & 1 deletion packages/scratch-gui/src/components/modal/modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ModalComponent = props => (
src={props.headerImage}
/>
) : null}
{props.contentLabel}
{props.headerTitle || props.contentLabel}
</div>
{props.headerActions ? (
<div
Expand Down Expand Up @@ -123,6 +123,7 @@ ModalComponent.propTypes = {
headerActions: PropTypes.node,
headerClassName: PropTypes.string,
headerImage: PropTypes.string,
headerTitle: PropTypes.node,
isRtl: PropTypes.bool,
loading: PropTypes.bool,
onHelp: PropTypes.func,
Expand Down
15 changes: 12 additions & 3 deletions packages/scratch-gui/src/containers/blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {injectExtensionBlockMode, injectExtensionCategoryMode} from '../lib/sett

import {connect} from 'react-redux';
import {updateToolbox} from '../reducers/toolbox';
import {setScratchBlocks} from '../reducers/block-display';
import {activateColorPicker} from '../reducers/color-picker';
import {closeExtensionLibrary, openSoundRecorder, openConnectionModal} from '../reducers/modals';
import {activateCustomProcedures, deactivateCustomProcedures} from '../reducers/custom-procedures';
Expand Down Expand Up @@ -93,6 +94,7 @@ class Blocks extends React.Component {
}
componentDidMount () {
this.ScratchBlocks = VMScratchBlocks(this.props.vm, this.props.useCatBlocks);
this.props.onSetScratchBlocks(this.ScratchBlocks);
this.ScratchBlocks.prompt = this.handlePromptStart;
this.ScratchBlocks.statusButtonCallback = this.handleConnectionModalStart;
this.ScratchBlocks.recordSoundCallback = this.handleOpenSoundRecorder;
Expand Down Expand Up @@ -600,7 +602,6 @@ class Blocks extends React.Component {
});
}
render () {

const {
anyModalVisible,
canUseCloud,
Expand All @@ -614,6 +615,7 @@ class Blocks extends React.Component {
onActivateColorPicker,
onOpenConnectionModal,
onOpenSoundRecorder,
onSetScratchBlocks,
updateToolboxState,
onActivateCustomProcedures,
onRequestCloseExtensionLibrary,
Expand All @@ -624,7 +626,7 @@ class Blocks extends React.Component {
workspaceMetrics,
...props
} = this.props;

return (
<React.Fragment>
<DroppableBlocks
Expand Down Expand Up @@ -676,13 +678,17 @@ Blocks.propTypes = {
isRtl: PropTypes.bool,
isVisible: PropTypes.bool,
locale: PropTypes.string.isRequired,
messages: PropTypes.objectOf(PropTypes.string),
messages: PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.object
])),
onActivateColorPicker: PropTypes.func,
onActivateCustomProcedures: PropTypes.func,
onOpenConnectionModal: PropTypes.func,
onOpenSoundRecorder: PropTypes.func,
onRequestCloseCustomProcedures: PropTypes.func,
onRequestCloseExtensionLibrary: PropTypes.func,
onSetScratchBlocks: PropTypes.func,
options: PropTypes.shape({
media: PropTypes.string,
zoom: PropTypes.shape({
Expand Down Expand Up @@ -761,6 +767,9 @@ const mapDispatchToProps = dispatch => ({
onRequestCloseCustomProcedures: data => {
dispatch(deactivateCustomProcedures(data));
},
onSetScratchBlocks: scratchBlocks => {
dispatch(setScratchBlocks(scratchBlocks));
},
updateToolboxState: toolboxXML => {
dispatch(updateToolbox(toolboxXML));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ SpriteSelectorItem.propTypes = {
asset: PropTypes.object,
costumeURL: PropTypes.string,
dispatchSetHoveredSprite: PropTypes.func.isRequired,
dragPayload: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
dragPayload: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
dragType: PropTypes.string,
dragging: PropTypes.bool,
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
Expand Down
5 changes: 4 additions & 1 deletion packages/scratch-gui/src/lib/vm-manager-hoc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ const vmManagerHOC = function (WrappedComponent) {
isStarted: PropTypes.bool,
loadingState: PropTypes.oneOf(LoadingStates),
locale: PropTypes.string,
messages: PropTypes.objectOf(PropTypes.string),
messages: PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.object
])),
onError: PropTypes.func,
onLoadedProject: PropTypes.func,
onSetProjectUnchanged: PropTypes.func,
Expand Down
6 changes: 3 additions & 3 deletions packages/scratch-gui/src/locales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import ja from './ja';
import jaHira from './ja-Hira';

const langs = {
"en": en,
"ja": ja,
"ja-Hira": jaHira
'en': en,
'ja': ja,
'ja-Hira': jaHira
};

Object.keys(langs).forEach(lang => {
Expand Down
1 change: 1 addition & 0 deletions packages/scratch-gui/src/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default {
'gui.modal.reload': '再読み込み',
'gui.modal.stop': '中止',
'gui.menuBar.loadFromUrl': 'Scratchから読み込む',
'gui.menuBar.colorMode': 'カラーモード',
'gui.menuBar.meshV2': 'メッシュ',
'gui.sharedMessages.backdrop': '背景{index}',
'gui.sharedMessages.costume': 'コスチューム{index}',
Expand Down