From c2ead2f920a9a4747dfa43cae90ca66e406f609f Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Sat, 24 Jan 2026 08:25:14 +0900 Subject: [PATCH] fix: update messages PropType and cleanup debug logs - Updated 'messages' PropType to allow objects (required by format-message) - Removed debug console logs and comments - Fixed lint errors in locales/index.js - (Includes previous changes: modal header improvements and ja translations) Co-Authored-By: Gemini --- packages/scratch-gui/.env.example | 37 +++++++++++++++++++ .../connection-modal/connection-modal.jsx | 3 +- .../src/components/modal/modal.jsx | 3 +- .../scratch-gui/src/containers/blocks.jsx | 15 ++++++-- .../src/containers/sprite-selector-item.jsx | 2 +- .../scratch-gui/src/lib/vm-manager-hoc.jsx | 5 ++- packages/scratch-gui/src/locales/index.js | 6 +-- packages/scratch-gui/src/locales/ja.js | 1 + 8 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 packages/scratch-gui/.env.example diff --git a/packages/scratch-gui/.env.example b/packages/scratch-gui/.env.example new file mode 100644 index 00000000000..2b0c7f11357 --- /dev/null +++ b/packages/scratch-gui/.env.example @@ -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 diff --git a/packages/scratch-gui/src/components/connection-modal/connection-modal.jsx b/packages/scratch-gui/src/components/connection-modal/connection-modal.jsx index df7d3096b41..5b6658cee3b 100644 --- a/packages/scratch-gui/src/components/connection-modal/connection-modal.jsx +++ b/packages/scratch-gui/src/components/connection-modal/connection-modal.jsx @@ -42,7 +42,8 @@ const ConnectionModalComponent = props => { ); return ( ( src={props.headerImage} /> ) : null} - {props.contentLabel} + {props.headerTitle || props.contentLabel} {props.headerActions ? (
({ onRequestCloseCustomProcedures: data => { dispatch(deactivateCustomProcedures(data)); }, + onSetScratchBlocks: scratchBlocks => { + dispatch(setScratchBlocks(scratchBlocks)); + }, updateToolboxState: toolboxXML => { dispatch(updateToolbox(toolboxXML)); }, diff --git a/packages/scratch-gui/src/containers/sprite-selector-item.jsx b/packages/scratch-gui/src/containers/sprite-selector-item.jsx index 5080112e26c..f413aacd1e2 100644 --- a/packages/scratch-gui/src/containers/sprite-selector-item.jsx +++ b/packages/scratch-gui/src/containers/sprite-selector-item.jsx @@ -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]), diff --git a/packages/scratch-gui/src/lib/vm-manager-hoc.jsx b/packages/scratch-gui/src/lib/vm-manager-hoc.jsx index 152a8a432ee..60c5c67e6e1 100644 --- a/packages/scratch-gui/src/lib/vm-manager-hoc.jsx +++ b/packages/scratch-gui/src/lib/vm-manager-hoc.jsx @@ -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, diff --git a/packages/scratch-gui/src/locales/index.js b/packages/scratch-gui/src/locales/index.js index 56dd87451ae..1608b26a2d4 100644 --- a/packages/scratch-gui/src/locales/index.js +++ b/packages/scratch-gui/src/locales/index.js @@ -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 => { diff --git a/packages/scratch-gui/src/locales/ja.js b/packages/scratch-gui/src/locales/ja.js index 3ef57d44c89..8f871177280 100644 --- a/packages/scratch-gui/src/locales/ja.js +++ b/packages/scratch-gui/src/locales/ja.js @@ -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}',