Skip to content

Commit cccf5ac

Browse files
authored
Merge branch 'develop' into fix/scroll-position
2 parents a267f28 + 42ecd5d commit cccf5ac

File tree

9 files changed

+62
-80
lines changed

9 files changed

+62
-80
lines changed

client/common/icons.jsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ import CircleInfo from '../images/circle-info.svg';
2929
// could also give these a default size, color, etc. based on the theme
3030
// Need to add size to these - like small icon, medium icon, large icon. etc.
3131
function withLabel(SvgComponent) {
32-
const Icon = (props) => {
33-
const StyledIcon = styled(SvgComponent)`
34-
&&& {
35-
color: ${prop('Icon.default')};
32+
const StyledIcon = styled(SvgComponent)`
33+
&&& {
34+
color: ${prop('Icon.default')};
35+
& g,
36+
& path,
37+
& polygon {
38+
opacity: 1;
39+
fill: ${prop('Icon.default')};
40+
}
41+
&:hover {
42+
color: ${prop('Icon.hover')};
3643
& g,
3744
& path,
3845
& polygon {
3946
opacity: 1;
40-
fill: ${prop('Icon.default')};
41-
}
42-
&:hover {
43-
color: ${prop('Icon.hover')};
44-
& g,
45-
& path,
46-
& polygon {
47-
opacity: 1;
48-
fill: ${prop('Icon.hover')};
49-
}
47+
fill: ${prop('Icon.hover')};
5048
}
5149
}
52-
`;
50+
}
51+
`;
5352

53+
const Icon = (props) => {
5454
const { 'aria-label': ariaLabel } = props;
5555
if (ariaLabel) {
5656
return (

client/modules/IDE/components/About.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import React from 'react';
2+
import { useSelector } from 'react-redux';
23
import { Helmet } from 'react-helmet';
34
import { useTranslation } from 'react-i18next';
45
import { Link } from 'react-router';
56
import SquareLogoIcon from '../../../images/p5js-square-logo.svg';
67
// import PlayIcon from '../../../images/play.svg';
78
import AsteriskIcon from '../../../images/p5-asterisk.svg';
9+
import packageData from '../../../../package.json';
810

911
function About(props) {
1012
const { t } = useTranslation();
13+
const p5version = useSelector((state) => {
14+
const index = state.files.find((file) => file.name === 'index.html');
15+
return index?.content.match(/\/p5\.js\/([\d.]+)\//)?.[1];
16+
});
1117
return (
1218
<div className="about__content">
1319
<Helmet>
@@ -20,6 +26,14 @@ function About(props) {
2026
aria-label={t('Common.p5logoARIA')}
2127
focusable="false"
2228
/>
29+
<div className="about__content-column">
30+
<p className="about__version-info">
31+
Web Editor: <span>v{packageData?.version}</span>
32+
</p>
33+
<p className="about__version-info">
34+
p5.js: <span>v{p5version}</span>
35+
</p>
36+
</div>
2337
</div>
2438
<div className="about__content-column">
2539
<h3 className="about__content-column-title">{t('About.NewP5')}</h3>
Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
import PropTypes from 'prop-types';
21
import React from 'react';
3-
import { bindActionCreators } from 'redux';
4-
import { connect } from 'react-redux';
2+
import { useDispatch, useSelector } from 'react-redux';
53
import { useTranslation } from 'react-i18next';
6-
import * as ToastActions from '../actions/toast';
4+
import { hideToast } from '../actions/toast';
75

86
import ExitIcon from '../../../images/exit.svg';
97

10-
function Toast(props) {
8+
export default function Toast() {
9+
const { text, isVisible } = useSelector((state) => state.toast);
10+
const dispatch = useDispatch();
1111
const { t } = useTranslation();
12+
if (!isVisible) {
13+
return null;
14+
}
1215
return (
1316
<section className="toast">
14-
<p>{t(props.text)}</p>
17+
<p>{t(text)}</p>
1518
<button
1619
className="toast__close"
17-
onClick={props.hideToast}
20+
onClick={() => dispatch(hideToast())}
1821
aria-label="Close Alert"
1922
>
2023
<ExitIcon focusable="false" aria-hidden="true" />
2124
</button>
2225
</section>
2326
);
2427
}
25-
26-
Toast.propTypes = {
27-
text: PropTypes.string.isRequired,
28-
hideToast: PropTypes.func.isRequired
29-
};
30-
31-
function mapStateToProps(state) {
32-
return state.toast;
33-
}
34-
35-
function mapDispatchToProps(dispatch) {
36-
return bindActionCreators(ToastActions, dispatch);
37-
}
38-
39-
export default connect(mapStateToProps, mapDispatchToProps)(Toast);

client/modules/IDE/pages/IDEView.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import * as ProjectActions from '../actions/project';
2626
import * as EditorAccessibilityActions from '../actions/editorAccessibility';
2727
import * as PreferencesActions from '../actions/preferences';
2828
import * as UserActions from '../../User/actions';
29-
import * as ToastActions from '../actions/toast';
3029
import * as ConsoleActions from '../actions/console';
3130
import { getHTMLFile } from '../reducers/files';
3231
import Overlay from '../../App/components/Overlay';
@@ -255,7 +254,7 @@ class IDEView extends React.Component {
255254
<Helmet>
256255
<title>{getTitle(this.props)}</title>
257256
</Helmet>
258-
{this.props.toast.isVisible && <Toast />}
257+
<Toast />
259258
<Nav
260259
warnIfUnsavedChanges={this.handleUnsavedChanges}
261260
cmController={this.cmController}
@@ -561,9 +560,6 @@ IDEView.propTypes = {
561560
closeNewFileModal: PropTypes.func.isRequired,
562561
closeShareModal: PropTypes.func.isRequired,
563562
closeKeyboardShortcutModal: PropTypes.func.isRequired,
564-
toast: PropTypes.shape({
565-
isVisible: PropTypes.bool.isRequired
566-
}).isRequired,
567563
autosaveProject: PropTypes.func.isRequired,
568564
router: PropTypes.shape({
569565
setRouteLeaveHook: PropTypes.func
@@ -594,7 +590,6 @@ function mapStateToProps(state) {
594590
editorAccessibility: state.editorAccessibility,
595591
user: state.user,
596592
project: state.project,
597-
toast: state.toast,
598593
console: state.console,
599594
isUserOwner: getIsUserOwner(state)
600595
};
@@ -610,7 +605,6 @@ function mapDispatchToProps(dispatch) {
610605
IDEActions,
611606
PreferencesActions,
612607
UserActions,
613-
ToastActions,
614608
ConsoleActions
615609
),
616610
dispatch

client/modules/IDE/pages/MobileIDEView.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ const MobileIDEView = (props) => {
278278
files,
279279
toggleForceDesktop,
280280
logoutUser,
281-
toast,
282281
isUserOwner
283282
} = props;
284283

@@ -383,7 +382,7 @@ const MobileIDEView = (props) => {
383382
/>
384383
</li>
385384
</Header>
386-
{toast.isVisible && <Toast />}
385+
<Toast />
387386

388387
<IDEWrapper>
389388
<Editor provideController={setCmController} />
@@ -456,10 +455,6 @@ MobileIDEView.propTypes = {
456455
username: PropTypes.string
457456
}).isRequired,
458457

459-
toast: PropTypes.shape({
460-
isVisible: PropTypes.bool
461-
}).isRequired,
462-
463458
logoutUser: PropTypes.func.isRequired,
464459

465460
getProject: PropTypes.func.isRequired,
@@ -490,7 +485,6 @@ function mapStateToProps(state) {
490485
preferences: state.preferences,
491486
user: state.user,
492487
project: state.project,
493-
toast: state.toast,
494488
console: state.console,
495489
isUserOwner: getIsUserOwner(state)
496490
};

client/modules/Preview/EmbedFrame.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function injectLocalFiles(files, htmlFile, options) {
227227
const accessiblelib = sketchDoc.createElement('script');
228228
accessiblelib.setAttribute(
229229
'src',
230-
'https://cdn.jsdelivr.net/gh/processing/p5.accessibility@v0.1.1/dist/p5.accessibility.js'
230+
'https://cdn.jsdelivr.net/gh/processing/p5.accessibility@0.1.1/dist/p5-accessibility.js'
231231
);
232232
const accessibleOutputs = sketchDoc.createElement('section');
233233
accessibleOutputs.setAttribute('id', 'accessible-outputs');

client/modules/User/pages/AccountView.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class AccountView extends React.Component {
6868
<Helmet>
6969
<title>{this.props.t('AccountView.Title')}</title>
7070
</Helmet>
71-
{this.props.toast.isVisible && <Toast />}
71+
<Toast />
7272

7373
<Nav layout="dashboard" />
7474

@@ -129,8 +129,7 @@ function mapStateToProps(state) {
129129
previousPath: state.ide.previousPath,
130130
user: state.user,
131131
apiKeys: state.user.apiKeys,
132-
theme: state.preferences.theme,
133-
toast: state.toast
132+
theme: state.preferences.theme
134133
};
135134
}
136135

@@ -151,9 +150,6 @@ AccountView.propTypes = {
151150
location: PropTypes.shape({
152151
search: PropTypes.string.isRequired,
153152
pathname: PropTypes.string.isRequired
154-
}).isRequired,
155-
toast: PropTypes.shape({
156-
isVisible: PropTypes.bool.isRequired
157153
}).isRequired
158154
};
159155

client/styles/components/_about.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@
7474
}
7575
}
7676

77+
.about__version-info {
78+
@include themify() {
79+
padding-top: #{8 / $base-font-size}rem;
80+
font-size: #{16 / $base-font-size}rem;
81+
span {
82+
color: getThemifyVariable('logo-color');
83+
}
84+
&:first-child {
85+
padding-top: #{30 /$base-font-size}rem;
86+
}
87+
}
88+
// span {
89+
// @include themify() {
90+
// fill: getThemifyVariable('logo-color');
91+
// }
92+
// }
93+
}
94+
7795
.about__footer {
7896
display: flex;
7997
justify-content: space-between;

contributor_docs/installation.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ _Note_: The installation steps assume you are using a Unix-like shell. If you ar
2525
7. Install MongoDB and make sure it is running
2626
* For Mac OSX with [homebrew](http://brew.sh/): `brew tap mongodb/brew` then `brew install mongodb-community` and finally start the server with `brew services start mongodb-community` or you can visit the installation guide here [Installation Guide For MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)
2727
* For Windows and Linux: [MongoDB Installation](https://docs.mongodb.com/manual/installation/)
28-
<<<<<<< HEAD:contributor_docs/installation.md
2928
8. `$ cp .env.example .env`
3029
9. (Optional) Update `.env` with necessary keys to enable certain app behaviors, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
3130
10. Run `$ npm run fetch-examples` to download the example sketches into a user called 'p5'. Note that you need to configure your GitHub Credentials, which you can do by following the [Github API Configuration](#github-api-configuration) section.
@@ -34,16 +33,6 @@ _Note_: The installation steps assume you are using a Unix-like shell. If you ar
3433
13. Navigate to [http://localhost:8000](http://localhost:8000) in your browser
3534
14. Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
3635
15. Open and close the Redux DevTools using `ctrl+h`, and move them with `ctrl+w`
37-
=======
38-
7. `$ cp .env.example .env`
39-
8. (Optional) Update `.env` with necessary keys to enable certain app behaviours, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
40-
9. Run `$ npm run fetch-examples` to download the example sketches into a user called 'p5'. Note that you need to configure your GitHub Credentials, which you can do by following the [Github API Configuration](#github-api-configuration) section.
41-
10. Enable Prettier in your text editor by following [this guide](https://prettier.io/docs/en/editors.html).
42-
11. `$ npm start`
43-
12. Navigate to [http://localhost:8000](http://localhost:8000) in your browser
44-
13. Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
45-
14. Open and close the Redux DevTools using `ctrl+h`, and move them with `ctrl+w`
46-
>>>>>>> 1129cb97b545e7fa0a7d463fcf3f1c596e1fbf49:developer_docs/installation.md
4736

4837
## Docker Installation
4938

@@ -54,7 +43,6 @@ Using Docker, you can have a complete, consistent development environment withou
5443
Note that this takes up a significant amount of space on your machine. Make sure you have at least 5GB free.
5544

5645
1. Install Docker for your operating system
57-
<<<<<<< HEAD:contributor_docs/installation.md
5846
* [Mac](https://www.docker.com/docker-mac)
5947
* [Windows](https://www.docker.com/docker-windows)
6048
2. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
@@ -64,16 +52,6 @@ Note that this takes up a significant amount of space on your machine. Make sure
6452
6. (Optional) Update `.env` with necessary keys to enable certain app behavoirs, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
6553
7. `$ docker-compose -f docker-compose-development.yml run --rm app npm run fetch-examples` - note that you need to configure your GitHub Credentials, which you can do by following the [Github API Configuration](#github-api-configuration) section.
6654
8. Enable Prettier in your text editor by following [this guide](https://prettier.io/docs/en/editors.html).
67-
=======
68-
* Mac: https://www.docker.com/docker-mac
69-
* Windows: https://www.docker.com/docker-windows
70-
2. Clone this repository and cd into it
71-
3. `$ docker-compose -f docker-compose-development.yml build`
72-
4. `$ cp .env.example .env`
73-
5. (Optional) Update `.env` with necessary keys to enable certain app behaviours, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
74-
6. `$ docker-compose -f docker-compose-development.yml run --rm app npm run fetch-examples` - note that you need to configure your GitHub Credentials, which you can do by following the [Github API Configuration](#github-api-configuration) section.
75-
7. Enable Prettier in your text editor by following [this guide](https://prettier.io/docs/en/editors.html).
76-
>>>>>>> 1129cb97b545e7fa0a7d463fcf3f1c596e1fbf49:developer_docs/installation.md
7755

7856
Now, anytime you wish to start the server with its dependencies, you can run:
7957

0 commit comments

Comments
 (0)