Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8a5f45f
implement codemirror
ampelectrecuted Dec 1, 2025
2e5cc29
Merge branch 'nanoscript' of https://github.com/OmniBlocks/scratch-gu…
ampelectrecuted Dec 1, 2025
223453f
ugh i've tried to get it to scroll instead of overflowing but it won'…
ampelectrecuted Dec 1, 2025
5600c89
remove unused dependencies
ampelectrecuted Dec 1, 2025
77cab54
Merge branch 'main' into nanoscript
ampelectrecuted Dec 1, 2025
2352b86
i hate npm my build is taking too long im gonna push
ampelectrecuted Dec 1, 2025
98bd2d0
hi
ampelectrecuted Dec 1, 2025
8205ddf
package lock
ampelectrecuted Dec 1, 2025
97cc21a
fixup
ampelectrecuted Dec 1, 2025
b76e7cd
var support
ampelectrecuted Dec 1, 2025
3795b52
bamboozlement
ampelectrecuted Dec 1, 2025
6245a65
nanoscript refactor
ampelectrecuted Dec 1, 2025
7e71183
fix
ampelectrecuted Dec 1, 2025
2288ee1
custom reporters by default
ampelectrecuted Dec 1, 2025
a45c031
homepage
ampelectrecuted Dec 1, 2025
cf8a14e
fix the version number system, now it uses the package.json version
ampelectrecuted Dec 1, 2025
f9c98e2
fix NS dark mode logic
ampelectrecuted Dec 1, 2025
27c3503
eeeeeeeeee
ampelectrecuted Dec 1, 2025
2f866a2
add border to sidebar
ampelectrecuted Dec 1, 2025
15bbb8a
remove old dupes
ampelectrecuted Dec 1, 2025
e50ecee
improve website
ampelectrecuted Dec 1, 2025
1bdcd57
show "visual ide" name in the editor itself
ampelectrecuted Dec 1, 2025
3e69947
Merge remote-tracking branch 'origin/develop' into nanoscript
ampelectrecuted Dec 2, 2025
c2aadb0
Merge remote-tracking branch 'origin/main' into nanoscript
ampelectrecuted Dec 2, 2025
953603c
Merge branch 'main' into nanoscript
supervoidcoder Dec 19, 2025
6400c31
🎨 Auto-fix ESLint issues
github-actions[bot] Dec 19, 2025
8758524
Merge branch 'main' into nanoscript
supervoidcoder Dec 19, 2025
dc39282
Merge branch 'main' into nanoscript
supervoidcoder Dec 19, 2025
b3ee8be
Merge branch 'main' into nanoscript
ampelectrecuted Dec 19, 2025
1121b29
🎨 Auto-fix ESLint issues
github-actions[bot] Dec 19, 2025
57a6f97
Merge branch 'main' into nanoscript
ampelectrecuted Dec 27, 2025
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
1 change: 1 addition & 0 deletions eslint-report.json

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@
}
},
"dependencies": {
"@codemirror/autocomplete": "^6.14.0",
"@codemirror/language": "^6.11.3",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.38.8",
"@ffmpeg/ffmpeg": "^0.12.15",
"@ffmpeg/util": "^0.12.2",
"@lezer/highlight": "^1.2.3",
"@lezer/lr": "^1.4.4",
"@microbit/microbit-universal-hex": "0.2.2",
"@turbowarp/jszip": "^3.11.1",
"@turbowarp/nanolog": "^0.2.0",
Expand All @@ -47,6 +53,7 @@
"base64-loader": "1.0.0",
"bowser": "1.9.4",
"classnames": "2.2.6",
"codemirror": "^6.0.2",
"computed-style-to-inline-style": "3.0.0",
"cookie": "0.5.0",
"copy-webpack-plugin": "6.4.1",
Expand Down
4 changes: 4 additions & 0 deletions src/components/blocks/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@
min-width: auto;
min-height: auto;
}

.blocks :global(.blocklyZoom) {
transform: scale(0) !important;
}
17 changes: 17 additions & 0 deletions src/components/gui/gui.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

display: flex;
flex-direction: column;
min-height: 0;
}

.tab-list {
Expand Down Expand Up @@ -343,6 +344,22 @@ $fade-out-distance: 15px;
background-color: white;
}

.nanoscript-container {
position: absolute;
bottom: 0;
right: 0;
margin: 20px;
margin-right: 32px;
display: flex;
}
.nanoscript-container.not-nano {
gap: $space;
margin-right: 30px;
}
.button-row {
background: $ui-white;
border-radius: $form-radius;
}
/* Mobile support */
@media (max-width: 768px) {
.flex-wrapper {
Expand Down
86 changes: 71 additions & 15 deletions src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ import TWRestorePointManager from '../../containers/tw-restore-point-manager.jsx
import TWFontsModal from '../../containers/tw-fonts-modal.jsx';
import TWUnknownPlatformModal from '../../containers/tw-unknown-platform-modal.jsx';
import TWInvalidProjectModal from '../../containers/tw-invalid-project-modal.jsx';
import NanoscriptEditor from '../ob-nanoscript-editor/nanoscript-editor.jsx';

import {STAGE_SIZE_MODES, FIXED_WIDTH, UNCONSTRAINED_NON_STAGE_WIDTH} from '../../lib/layout-constants';
import {resolveStageSize} from '../../lib/screen-utils';
import {Theme} from '../../lib/themes';
import AddonHooks from '../../addons/hooks.js';
import ToggleButtons from '../toggle-buttons/toggle-buttons.jsx';
import Prompt from '../../containers/prompt.jsx';
import nanoscriptIcon from '!../../lib/tw-recolor/build!./nanoscriptIcon.svg';

import {isRendererSupported, isBrowserSupported} from '../../lib/tw-environment-support-prober';

Expand All @@ -50,6 +55,7 @@ import codeIcon from '!../../lib/tw-recolor/build!./icon--code.svg';
import costumesIcon from '!../../lib/tw-recolor/build!./icon--costumes.svg';
import soundsIcon from '!../../lib/tw-recolor/build!./icon--sounds.svg';
import songsIcon from '!../../lib/tw-recolor/build!./icon--songs.svg';
import SpinnerComponent from '../tw-loading-spinner/spinner.jsx';
const messages = defineMessages({
addExtension: {
id: 'gui.gui.addExtension',
Expand Down Expand Up @@ -399,7 +405,10 @@ const GUIComponent = props => {
</Tab>
</TabList>
<TabPanel className={tabClassNames.tabPanel}>
<Box className={styles.blocksWrapper}>
{isNano ? blocksTabVisible && <NanoscriptEditor
theme={theme}
vm={vm}
/> : <><Box className={styles.blocksWrapper}>
<Blocks
key={`${blocksId}/${theme.id}`}
canUseCloud={canUseCloud}
Expand All @@ -413,20 +422,67 @@ const GUIComponent = props => {
theme={theme}
vm={vm}
/>
</Box>
<Box className={styles.extensionButtonContainer}>
<button
className={styles.extensionButton}
title={intl.formatMessage(messages.addExtension)}
onClick={onExtensionButtonClick}
>
<img
className={styles.extensionButtonIcon}
draggable={false}
src={addExtensionIcon}
/>
</button>
</Box>
<Box className={styles.extensionButtonContainer}>
<button
className={styles.extensionButton}
title={intl.formatMessage(messages.addExtension)}
onClick={isNano ? () => {
alert('Adding extensions in NanoScript is not available yet');
} : onExtensionButtonClick}
>
<img
className={styles.extensionButtonIcon}
draggable={false}
src={addExtensionIcon}
/>{isNano && intl.formatMessage(messages.addExtension)}
</button>
</Box>
</Box></>}
<div className={classNames(styles.nanoscriptContainer, !isNano && styles.notNano)}>
{!isNano && <ToggleButtons
className={styles.buttonRow}
buttons={[
{
handleClick: () => {
window.blocklyWorkspace.zoomCenter(1);
},
isSelected: false,
children: '+'
},
{
handleClick: () => {
window.blocklyWorkspace.zoomCenter(-1);
},
isSelected: false,
children: '-'
},
{
handleClick: () => {
window.blocklyWorkspace.setScale(0.675);
},
isSelected: false,
children: '='
}
]}
/>}
<ToggleButtons
className={styles.buttonRow}
buttons={[
{
handleClick: () => setNano(false),
icon: codeIcon,
isSelected: !isNano,
title: 'Block-based'
},
{
handleClick: () => setNano(true),
icon: nanoscriptIcon,
isSelected: isNano,
title: 'Text-based'
}
]}
/>
</div>
<Box className={styles.watermark}>
<Watermark />
</Box>
Expand Down
1 change: 1 addition & 0 deletions src/components/gui/nanoscriptIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/components/gui/ob-codemirror-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export {EditorView} from '@codemirror/view';
export {basicSetup} from 'codemirror';
export {LRLanguage, LanguageSupport, syntaxHighlighting, HighlightStyle} from '@codemirror/language';
export {styleTags, tags} from '@lezer/highlight';
export {autocompletion, completeFromList} from '@codemirror/autocomplete';
Loading
Loading