mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-24 05:09:52 -05:00
Merge branch 'develop' into addLine
This commit is contained in:
commit
cc50a14e1d
14 changed files with 29 additions and 50 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -12,3 +12,7 @@ dist/*
|
||||||
# Editors
|
# Editors
|
||||||
/#*
|
/#*
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
# generated translation files
|
||||||
|
/translations
|
||||||
|
/locale
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"en": {
|
|
||||||
"paint.brushMode.brush": "Brush",
|
|
||||||
"paint.eraserMode.eraser": "Eraser"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -74,8 +74,8 @@ BrushMode.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
brushModeState: state.brushMode,
|
brushModeState: state.scratchPaint.brushMode,
|
||||||
isBrushModeActive: state.mode === Modes.BRUSH
|
isBrushModeActive: state.scratchPaint.mode === Modes.BRUSH
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
changeBrushSize: brushSize => {
|
changeBrushSize: brushSize => {
|
||||||
|
|
|
@ -70,8 +70,8 @@ EraserMode.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
eraserModeState: state.eraserMode,
|
eraserModeState: state.scratchPaint.eraserMode,
|
||||||
isEraserModeActive: state.mode === Modes.ERASER
|
isEraserModeActive: state.scratchPaint.mode === Modes.ERASER
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
changeBrushSize: brushSize => {
|
changeBrushSize: brushSize => {
|
||||||
|
|
|
@ -281,8 +281,8 @@ LineMode.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
lineModeState: state.lineMode,
|
lineModeState: state.scratchPaint.lineMode,
|
||||||
isLineModeActive: state.mode === Modes.LINE
|
isLineModeActive: state.scratchPaint.mode === Modes.LINE
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
changeLineWidth: lineWidth => {
|
changeLineWidth: lineWidth => {
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
import PaintEditor from './containers/paint-editor.jsx';
|
import PaintEditor from './containers/paint-editor.jsx';
|
||||||
|
import ScratchPaintReducer from './reducers/scratch-paint-reducer';
|
||||||
|
|
||||||
export default PaintEditor;
|
export {
|
||||||
|
PaintEditor as default,
|
||||||
|
ScratchPaintReducer
|
||||||
|
};
|
||||||
|
|
|
@ -3,8 +3,8 @@ import ReactDOM from 'react-dom';
|
||||||
import PaintEditor from '..';
|
import PaintEditor from '..';
|
||||||
import {Provider} from 'react-redux';
|
import {Provider} from 'react-redux';
|
||||||
import {createStore} from 'redux';
|
import {createStore} from 'redux';
|
||||||
import reducer from '../reducers/combine-reducers';
|
import reducer from './reducers/combine-reducers';
|
||||||
import {intlInitialState, IntlProvider} from '../reducers/intl.js';
|
import {intlInitialState, IntlProvider} from './reducers/intl.js';
|
||||||
|
|
||||||
const appTarget = document.createElement('div');
|
const appTarget = document.createElement('div');
|
||||||
document.body.appendChild(appTarget);
|
document.body.appendChild(appTarget);
|
||||||
|
|
8
src/playground/reducers/combine-reducers.js
Normal file
8
src/playground/reducers/combine-reducers.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import {combineReducers} from 'redux';
|
||||||
|
import intlReducer from './intl';
|
||||||
|
import {ScratchPaintReducer} from '../..';
|
||||||
|
|
||||||
|
export default combineReducers({
|
||||||
|
intl: intlReducer,
|
||||||
|
scratchPaint: ScratchPaintReducer
|
||||||
|
});
|
|
@ -2,7 +2,7 @@ import {addLocaleData} from 'react-intl';
|
||||||
import {updateIntl as superUpdateIntl} from 'react-intl-redux';
|
import {updateIntl as superUpdateIntl} from 'react-intl-redux';
|
||||||
import {IntlProvider, intlReducer} from 'react-intl-redux';
|
import {IntlProvider, intlReducer} from 'react-intl-redux';
|
||||||
|
|
||||||
import locales from '../locale.js';
|
import locales from '../../locale.js';
|
||||||
|
|
||||||
Object.keys(locales).forEach(locale => {
|
Object.keys(locales).forEach(locale => {
|
||||||
// TODO: will need to handle locales not in the default intl - see www/custom-locales
|
// TODO: will need to handle locales not in the default intl - see www/custom-locales
|
|
@ -1,12 +1,12 @@
|
||||||
import {combineReducers} from 'redux';
|
import {combineReducers} from 'redux';
|
||||||
import intlReducer from './intl';
|
|
||||||
import modeReducer from './modes';
|
import modeReducer from './modes';
|
||||||
import brushModeReducer from './brush-mode';
|
import brushModeReducer from './brush-mode';
|
||||||
import eraserModeReducer from './eraser-mode';
|
import eraserModeReducer from './eraser-mode';
|
||||||
|
import lineModeReducer from './line-mode';
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
intl: intlReducer,
|
|
||||||
mode: modeReducer,
|
mode: modeReducer,
|
||||||
brushMode: brushModeReducer,
|
brushMode: brushModeReducer,
|
||||||
eraserMode: eraserModeReducer
|
eraserMode: eraserModeReducer,
|
||||||
|
lineMode: lineModeReducer
|
||||||
});
|
});
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"paint.brushMode.brush": {
|
|
||||||
"message": "Brush",
|
|
||||||
"description": "Label for the brush tool"
|
|
||||||
},
|
|
||||||
"paint.eraserMode.eraser": {
|
|
||||||
"message": "Eraser",
|
|
||||||
"description": "Label for the eraser tool"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "paint.brushMode.brush",
|
|
||||||
"description": "Label for the brush tool",
|
|
||||||
"defaultMessage": "Brush"
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,7 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "paint.eraserMode.eraser",
|
|
||||||
"description": "Label for the eraser tool",
|
|
||||||
"defaultMessage": "Eraser"
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,7 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "paint.lineMode.line",
|
|
||||||
"description": "Label for the line tool, which draws straight line segments",
|
|
||||||
"defaultMessage": "Line"
|
|
||||||
}
|
|
||||||
]
|
|
Loading…
Reference in a new issue