Skip to content

Commit b3a4d7b

Browse files
authored
Merge branch 'develop' into refactor/modal
2 parents fc1e4b4 + 2cd9067 commit b3a4d7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3178
-1092
lines changed

.github/ISSUE_TEMPLATE/feature-request.md renamed to .github/ISSUE_TEMPLATE/🌱-new-feature-request.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
name: New Feature Request
2+
name: "\U0001F331 New Feature Request"
33
about: This template is for requesting a new feature be added.
44
title: ''
5-
labels: feature request
5+
labels: ''
66
assignees: ''
77

88
---
99

1010
<!--
1111
Hi there!
1212
13-
Thank you for contributing to the p5.js Editor project
13+
Thank you for contributing to the p5.js Editor project.
1414
1515
Until further notice, we will only add new features that increase access.
1616

.github/ISSUE_TEMPLATE/found-a-bug.md renamed to .github/ISSUE_TEMPLATE/🐛-found-a-bug.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
2-
name: Found a Bug
3-
about: This template is for reporting bugs (broken or incorrect behavior). If you have questions about your own code, please visit our forum discourse.processing.org instead.
2+
name: "\U0001F41B Found a Bug"
3+
about: This template is for reporting bugs (broken or incorrect behavior). If you
4+
have questions about your own code, please visit our forum discourse.processing.org
5+
instead.
46
title: ''
57
labels: bug
68
assignees: ''

.github/ISSUE_TEMPLATE/existing-feature-enhancement.md renamed to .github/ISSUE_TEMPLATE/💡-existing-feature-enhancement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: Existing Feature Enhancement
2+
name: "\U0001F4A1 Existing Feature Enhancement"
33
about: This template is for suggesting an improvement for an existing feature.
44
title: ''
5-
labels: enhancement
5+
labels: ''
66
assignees: ''
77

88
---

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# [p5.js Editor](https://editor.p5js.org)
22

3-
4-
Documentation is also available in the following languages:
5-
6-
[한국어](https://github.com/processing/p5.js-web-editor/blob/develop/translations/ko)
7-
83
## Welcome! 👋👋🏿👋🏽👋🏻👋🏾👋🏼
94

105
The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything. It is designed with beginners in mind, limiting features and frills. The editor is free and open-source because we believe software, and the tools to learn it, should be accessible to everyone.

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/components/Nav.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,26 @@ class Nav extends React.PureComponent {
667667
हिन्दी
668668
</button>
669669
</li>
670+
<li className="nav__dropdown-item">
671+
<button
672+
onFocus={this.handleFocusForLang}
673+
onBlur={this.handleBlur}
674+
value="ko"
675+
onClick={(e) => this.handleLangSelection(e)}
676+
>
677+
한국어
678+
</button>
679+
</li>
680+
<li className="nav__dropdown-item">
681+
<button
682+
onFocus={this.handleFocusForLang}
683+
onBlur={this.handleBlur}
684+
value="it"
685+
onClick={(e) => this.handleLangSelection(e)}
686+
>
687+
Italiano
688+
</button>
689+
</li>
670690
<li className="nav__dropdown-item">
671691
<button
672692
onFocus={this.handleFocusForLang}

client/i18n.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33
import Backend from 'i18next-http-backend';
4+
45
import {
56
enUS,
67
es,
78
ja,
89
hi,
10+
it,
11+
ko,
912
ptBR,
1013
de,
1114
frCA,
@@ -22,7 +25,9 @@ const availableLanguages = [
2225
'es-419',
2326
'fr-CA',
2427
'hi',
28+
'it',
2529
'ja',
30+
'ko',
2631
'pt-BR',
2732
'sv',
2833
'uk-UA',
@@ -37,7 +42,9 @@ export function languageKeyToLabel(lang) {
3742
'es-419': 'Español',
3843
'fr-CA': 'Français',
3944
hi: 'हिन्दी',
45+
it: 'Italiano',
4046
ja: '日本語',
47+
ko: '한국어',
4148
'pt-BR': 'Português',
4249
sv: 'Svenska',
4350
'uk-UA': 'Українська',
@@ -54,7 +61,9 @@ export function languageKeyToDateLocale(lang) {
5461
'es-419': es,
5562
'fr-CA': frCA,
5663
hi,
64+
it,
5765
ja,
66+
ko,
5867
'pt-BR': ptBR,
5968
sv,
6069
'uk-UA': uk,

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>

client/modules/IDE/components/PreviewFrame.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function PreviewFrame({ fullView }) {
2424
const frameUrl = previewUrl;
2525
const sandboxAttributes = `allow-forms allow-modals allow-pointer-lock allow-popups
2626
allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-downloads`;
27-
const allow = `accelerometer; ambient-light-sensor; autoplay; camera; encrypted-media; geolocation; gyroscope; \
27+
const allow = `accelerometer; ambient-light-sensor; autoplay; bluetooth; camera; encrypted-media; geolocation; gyroscope; \
2828
hid; microphone; magnetometer; midi; payment; usb; serial; vr; xr-spatial-tracking`;
2929

3030
return (

client/modules/IDE/reducers/files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ function draw() {
1212
const defaultHTML = `<!DOCTYPE html>
1313
<html lang="en">
1414
<head>
15-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.js"></script>
16-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/addons/p5.sound.min.js"></script>
15+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script>
16+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js"></script>
1717
<link rel="stylesheet" type="text/css" href="style.css">
1818
<meta charset="utf-8" />
1919

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/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;

client/styles/components/_preferences.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ input[type="number"]::-webkit-outer-spin-button {
237237
@include themify() {
238238
//for some reason this won't work for getThemifyVariable
239239
color: map-get($theme-map, "heavy-text-color");
240+
font-weight: bold;
240241
}
241242
}
242243

client/styles/components/_sidebar.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
white-space: nowrap;
116116
text-overflow: ellipsis;
117117
min-width: #{7 / $base-font-size}rem;
118+
white-space: pre;
118119
}
119120

120121
.sidebar__file-item-name-text {

client/testData/testReduxStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const initialTestState = {
6868
},
6969
{
7070
name: 'index.html',
71-
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <main> </main> <script src="sketch.js"></script> </body> </html>`,
71+
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <main> </main> <script src="sketch.js"></script> </body> </html>`,
7272
id: '606fc1c46045e19ca2ee2646',
7373
_id: '606fc1c46045e19ca2ee2646',
7474
fileType: 'file',

contributor_docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ This folder contains documents intended for developers of the p5.js Web Editor.
1212
* [Release](./release.md) - A guide to creating a production release.
1313

1414
## Documents to Create
15-
* Design Principles - reference [p5.js design principles](https://github.com/processing/p5.js/edit/develop/contributor_docs/design_principles.md)
16-
* Issue Labels - reference [p5.js issue labels](https://github.com/processing/p5.js/blob/develop/contributor_docs/issue_labels.md)
15+
* Design Principles - reference [p5.js design principles](https://github.com/processing/p5.js/blob/main/contributor_docs/design_principles.md)
16+
* Issue Labels - reference [p5.js issue labels](https://github.com/processing/p5.js/blob/main/contributor_docs/issue_labels.md)
1717
* File Structure - An explanation of the file structure of this application.

contributor_docs/accessibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
## Accessibility Guidelines
22

3-
Here is guide on [how to use the accessible editor](https://gist.github.com/MathuraMG/e86666b7b41fbc8c078bad9aff3f666d) and here is an overview of the [p5-accessibility.js](https://github.com/processing/p5.accessibility) library that makes p5.js sketches accessible to screen readers.
3+
Here is a guide on [how to use the accessible editor](https://gist.github.com/MathuraMG/e86666b7b41fbc8c078bad9aff3f666d) and here is an overview of the [p5-accessibility.js](https://github.com/processing/p5.accessibility) library that makes p5.js sketches accessible to screen readers.
44

55
The code for the p5.js web editor adheres to web accessibility standards. The following guidelines will help to ensure that accessibility continues to be a priority as development continues.
66

77
**Code Structure**
88

9-
* Screen Readers are an assistive technology for vision loss which helps users to navigate a web page. They are able to prioritize content based on the semantic meaning of HTML tags. Therefore, it is important to use specific tags, such as `nav`, `ul`, `li`, `section`, and so on. `div` is the least screen reader friendly tag. For example, [here is the semantic meaning of the `body` tag](http://html5doctor.com/element-index/#body)
9+
* Screen Readers are an assistive technology for vision loss that helps users to navigate a web page. They are able to prioritize content based on the semantic meaning of HTML tags. Therefore, it is important to use specific tags, such as `nav`, `ul`, `li`, `section`, and so on. `div` is the least screen reader-friendly tag. For example, [here is the semantic meaning of the `body` tag](http://html5doctor.com/element-index/#body)
1010
* All buttons/links/windows need to be accessible by the keyboard ( By tabbing, pressing space etc.)
11-
* In cases where tags are not screen reader friendly, we can take advantage of [tabIndex](http://webaim.org/techniques/keyboard/tabindex). Using tabIndex ensures that all elements are accessible via keyboard. [code example](https://github.com/processing/p5.js-web-editor/blob/develop/client/modules/IDE/components/Editor.jsx#L249)
11+
* In cases where tags are not screen reader-friendly, we can take advantage of [tabIndex](http://webaim.org/techniques/keyboard/tabindex). Using tabIndex ensures that all elements are accessible via keyboard. [code example](https://github.com/processing/p5.js-web-editor/blob/develop/client/modules/IDE/components/Editor.jsx#L249)
1212
* When opening a new window or pop up window, ensure the keyboard focus also moves to the new window. [code example](https://github.com/processing/p5.js-web-editor/blob/develop/client/modules/IDE/components/NewFileForm.jsx#L16)
1313

1414
**Labeling**

contributor_docs/deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WIP.
1717

1818
These are the steps that happen when you deploy the application.
1919

20-
1. Push to `develop` branch, or merge in a pull request to the `develop` branch.
20+
1. Push to the `develop` branch, or merge in a pull request to the `develop` branch.
2121
2. This triggers a build on [Travis CI](https://travis-ci.org/processing/p5.js-web-editor).
2222
3. Travis CI builds a (development) Docker image of the whole application.
2323
4. Travis CI runs some tests, which in this case, is just `npm run lint`. This could be updated in the future to include more extensive tests. If the tests fail, the build stops here.
@@ -47,7 +47,7 @@ If you are interested in hosting and deploying your own p5.js Web Editor instanc
4747

4848
1. Sign up for a free account at: [Heroku](https://www.heroku.com/)
4949
2. Click here: [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/processing/p5.js-web-editor/tree/develop)
50-
3. Enter a unique *App name*, this will become part of the url (i.e. https://app-name.herokuapp.com/)
50+
3. Enter a unique *App name*, this will become part of the URL (i.e. https://app-name.herokuapp.com/)
5151
4. Update any configuration variables, or accept the defaults for a quick evaluation (they can be changed later to enable full functionality)
5252
5. Click on the "Deploy app" button
5353
6. When complete, click on the "View app" button

contributor_docs/development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Follow the [installation guide](./installation.md).
2222
As a person contributing code but not creating production releases (this is most people!), here's what you need to know:
2323
* The default branch is `develop`. All pull requests should be made to this branch. It should be stable, and all commits are visible at a staging server.
2424
* When working on a bug or feature, you should branch from the `develop` branch. When you're done, you should open a pull request from your feature branch to `develop`.
25-
* The `release` branch is the live production branch, and is the code deployed to editor.p5js.org. Changes to this branch should be made carefully, and will be done using git tags.
25+
* The `release` branch is the live production branch and is the code deployed to editor.p5js.org. Changes to this branch should be made carefully and will be done using git tags.
2626
* Emergency hotfix changes should be branched from `release` and merged via a pull request to `release`. After a PR is merged, then the commits can be merged to `develop`.
2727

2828
See the [release guide](./release.md) for information about creating a release.
@@ -68,7 +68,7 @@ Structure your commit message like this:
6868
* Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed".
6969
* Link the GitHub issue you are working on in the summary line in brackets, e.g. [#123]
7070
* Always leave the second line blank.
71-
* Be as descriptive as possible in the description. It helps reasoning about the intention of commits and gives more context about why changes happened.
71+
* Be as descriptive as possible in the description. It helps to reason about the intention of commits and gives more context about why changes happened.
7272
* If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using `git add -p`.
7373
* Note that you can connect multiple issues to a commit, if necessary: `[#123][#456] Add Button component`
7474

0 commit comments

Comments
 (0)