Merge branch 'develop' into bugfix/npm-install
This commit is contained in:
commit
776db9da9d
13 files changed
+1569
-1397
No files matched your search
+17
-21
@@ -1,33 +1,29 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
dist: trusty
|
||||
node_js:
|
||||
- 6
|
||||
- 'node'
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
env:
|
||||
global:
|
||||
- BASE_PATH=/scratch-gui/
|
||||
- NODE_ENV=production
|
||||
install:
|
||||
- npm --production=false install
|
||||
- npm --production=false update
|
||||
after_script:
|
||||
- |
|
||||
# RELEASE_BRANCHES and NPM_TOKEN defined in Travis settings panel
|
||||
declare exitCode
|
||||
$(npm bin)/travis-after-all
|
||||
exitCode=$?
|
||||
if [[
|
||||
# Execute after all jobs finish successfully
|
||||
$exitCode = 0 &&
|
||||
# Only release on release branches
|
||||
$RELEASE_BRANCHES =~ $TRAVIS_BRANCH &&
|
||||
# Don't release on PR builds
|
||||
$TRAVIS_PULL_REQUEST = "false"
|
||||
]]; then
|
||||
# Publish to gh-pages as most recent committer
|
||||
git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
||||
git config --global user.name $(git log --pretty=format:"%an" -n1)
|
||||
npm run --silent deploy -- -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||
fi
|
||||
before_deploy:
|
||||
- git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
||||
- git config --global user.name $(git log --pretty=format:"%an" -n1)
|
||||
deploy:
|
||||
- provider: script
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $TRAVIS_BRANCH != master
|
||||
skip_cleanup: true
|
||||
script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||
- provider: script
|
||||
on:
|
||||
branch: master
|
||||
skip_cleanup: true
|
||||
script: npm run --silent deploy -- -x -a -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||
@@ -33,5 +33,10 @@ Then go to [http://localhost:8601/](http://localhost:8601/) - the playground out
|
||||
npm test
|
||||
```
|
||||
|
||||
## Publishing to GitHub Pages
|
||||
|
||||
You can publish the GUI to github.io so that others on the Internet can view it.
|
||||
[Read the wiki for a step-by-step guide.](https://github.com/LLK/scratch-gui/wiki/Publishing-to-GitHub-Pages)
|
||||
|
||||
## Donate
|
||||
We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!
|
||||
+4
-4
@@ -9,7 +9,8 @@
|
||||
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1)\"",
|
||||
"lint": "eslint . --ext .js,.jsx",
|
||||
"start": "webpack-dev-server",
|
||||
"test": "npm run lint && npm run build"
|
||||
"test": "npm run lint && npm run build",
|
||||
"watch": "webpack --progress --colors --watch"
|
||||
},
|
||||
"author": "Massachusetts Institute of Technology",
|
||||
"license": "BSD-3-Clause",
|
||||
@@ -36,7 +37,7 @@
|
||||
"eslint": "^3.16.1",
|
||||
"eslint-config-scratch": "^3.0.0",
|
||||
"eslint-plugin-react": "^7.0.1",
|
||||
"gh-pages": "^1.0.0",
|
||||
"gh-pages": "github:rschamp/gh-pages#publish-branch-to-subfolder",
|
||||
"html-webpack-plugin": "2.28.0",
|
||||
"immutable": "3.8.1",
|
||||
"lodash.bindall": "4.4.0",
|
||||
@@ -64,12 +65,11 @@
|
||||
"scratch-audio": "latest",
|
||||
"scratch-blocks": "latest",
|
||||
"scratch-render": "latest",
|
||||
"scratch-storage": "^0.1.0",
|
||||
"scratch-storage": "^0.2.0",
|
||||
"scratch-vm": "latest",
|
||||
"style-loader": "^0.18.0",
|
||||
"svg-to-image": "1.1.3",
|
||||
"svg-url-loader": "2.0.2",
|
||||
"travis-after-all": "^1.4.4",
|
||||
"webpack": "^2.4.1",
|
||||
"webpack-dev-server": "^2.4.1",
|
||||
"xhr": "2.4.0"
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
*/
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
|
||||
/*
|
||||
Stop scrollbar popping in and out from scratch-blocks border issue
|
||||
https://github.com/LLK/scratch-gui/issues/318
|
||||
*/
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.editor-wrapper {
|
||||
|
||||
@@ -119,6 +119,6 @@ GUIComponent.propTypes = {
|
||||
vm: PropTypes.instanceOf(VM).isRequired
|
||||
};
|
||||
GUIComponent.defaultProps = {
|
||||
basePath: '/'
|
||||
basePath: './'
|
||||
};
|
||||
module.exports = GUIComponent;
|
||||
@@ -18,6 +18,7 @@ class ModalComponent extends React.Component {
|
||||
isOpen={this.props.visible}
|
||||
overlayClassName={styles.modalOverlay}
|
||||
ref={m => (this.modal = m)}
|
||||
onRequestClose={this.props.onRequestClose}
|
||||
>
|
||||
<Box
|
||||
direction="column"
|
||||
|
||||
@@ -64,8 +64,8 @@ class Blocks extends React.Component {
|
||||
|
||||
// @todo hack to resize blockly manually in case resize happened while hidden
|
||||
if (this.props.isVisible) { // Scripts tab
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
this.workspace.setVisible(true);
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
this.workspace.toolbox_.refreshSelection();
|
||||
} else {
|
||||
this.workspace.setVisible(false);
|
||||
@@ -100,13 +100,13 @@ class Blocks extends React.Component {
|
||||
this.props.vm.removeListener('targetsUpdate', this.onTargetsUpdate);
|
||||
}
|
||||
updateToolboxBlockValue (id, value) {
|
||||
this.workspace
|
||||
const block = this.workspace
|
||||
.getFlyout()
|
||||
.getWorkspace()
|
||||
.getBlockById(id)
|
||||
.inputList[0]
|
||||
.fieldRow[0]
|
||||
.setValue(value);
|
||||
.getBlockById(id);
|
||||
if (block) {
|
||||
block.inputList[0].fieldRow[0].setValue(value);
|
||||
}
|
||||
}
|
||||
onTargetsUpdate () {
|
||||
if (this.props.vm.editingTarget) {
|
||||
@@ -225,7 +225,8 @@ Blocks.propTypes = {
|
||||
insertionMarkerOpacity: PropTypes.number,
|
||||
fieldShadow: PropTypes.string,
|
||||
dragShadowOpacity: PropTypes.number
|
||||
})
|
||||
}),
|
||||
comments: PropTypes.bool
|
||||
}),
|
||||
vm: PropTypes.instanceOf(VM).isRequired
|
||||
};
|
||||
@@ -252,7 +253,8 @@ Blocks.defaultOptions = {
|
||||
insertionMarkerOpacity: 0.2,
|
||||
fieldShadow: 'rgba(255, 255, 255, 0.3)',
|
||||
dragShadowOpacity: 0.6
|
||||
}
|
||||
},
|
||||
comments: false
|
||||
};
|
||||
|
||||
Blocks.defaultProps = {
|
||||
|
||||
+1
-7
@@ -1,4 +1,3 @@
|
||||
const PropTypes = require('prop-types');
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const {Provider} = require('react-redux');
|
||||
@@ -52,17 +51,12 @@ class App extends React.Component {
|
||||
if (this.state.projectData === null) return null;
|
||||
return (
|
||||
<GUI
|
||||
basePath={this.props.basePath}
|
||||
projectData={this.state.projectData}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
App.propTypes = {
|
||||
basePath: PropTypes.string
|
||||
};
|
||||
|
||||
const appTarget = document.createElement('div');
|
||||
appTarget.className = styles.app;
|
||||
document.body.appendChild(appTarget);
|
||||
@@ -74,6 +68,6 @@ const store = applyMiddleware(
|
||||
);
|
||||
ReactDOM.render((
|
||||
<Provider store={store}>
|
||||
<App basePath={process.env.BASE_PATH} />
|
||||
<App />
|
||||
</Provider>
|
||||
), appTarget);
|
||||
@@ -131,5 +131,10 @@ module.exports = function (vm) {
|
||||
this.jsonInit(json);
|
||||
};
|
||||
|
||||
ScratchBlocks.VerticalFlyout.getCheckboxState = function (blockId) {
|
||||
const monitoredBlock = vm.runtime.monitorBlocks._blocks[blockId];
|
||||
return monitoredBlock ? monitoredBlock.isMonitored : false;
|
||||
};
|
||||
|
||||
return ScratchBlocks;
|
||||
};
|
||||
+520
-520
File diff suppressed because it is too large.
Load diff
+998
-834
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -21,7 +21,7 @@ class Storage extends ScratchStorage {
|
||||
);
|
||||
this.addWebSource(
|
||||
[this.AssetType.ImageVector, this.AssetType.ImageBitmap, this.AssetType.Sound],
|
||||
asset => `${ASSET_SERVER}/internalapi/asset/${asset.assetId}.${asset.assetType.runtimeFormat}/get/`
|
||||
asset => `${ASSET_SERVER}/internalapi/asset/${asset.assetId}.${asset.dataFormat}/get/`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ module.exports = {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': '"' + process.env.NODE_ENV + '"',
|
||||
'process.env.BASE_PATH': '"' + (process.env.BASE_PATH || '/') + '"',
|
||||
'process.env.DEBUG': Boolean(process.env.DEBUG)
|
||||
}),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
|
||||
Reference in new issue
Block a user