Skip to content

Commit 158f09b

Browse files
committed
Merge develop
2 parents fbe1186 + 5d76e0b commit 158f09b

File tree

96 files changed

+6294
-2806
lines changed

Some content is hidden

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

96 files changed

+6294
-2806
lines changed

.env.example

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ EXAMPLE_USER_PASSWORD=hellop5js
1010
GG_EXAMPLES_USERNAME=generativedesign
1111
GG_EXAMPLES_EMAIL=benedikt.gross@generative-gestaltung.de
1212
GG_EXAMPLES_PASS=generativedesign
13-
ML5_LIBRARY_USERNAME=ml5
14-
ML5_LIBRARY_EMAIL=examples@ml5js.org
15-
ML5_LIBRARY_PASS=helloml5
1613
GITHUB_ID=<your-github-client-id>
1714
GITHUB_SECRET=<your-github-client-secret>
1815
GOOGLE_ID=<your-google-client-id> (use google+ api)
1916
GOOGLE_SECRET=<your-google-client-secret> (use google+ api)
2017
MAILGUN_DOMAIN=<your-mailgun-domain>
2118
MAILGUN_KEY=<your-mailgun-api-key>
19+
ML5_LIBRARY_USERNAME=ml5
20+
ML5_LIBRARY_EMAIL=examples@ml5js.org
21+
ML5_LIBRARY_PASS=helloml5
22+
MOBILE_ENABLED=true
2223
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
2324
PORT=8000
25+
PREVIEW_PORT=8002
26+
EDITOR_URL=http://localhost:8000
27+
PREVIEW_URL=http://localhost:8002
2428
S3_BUCKET=<your-s3-bucket>
2529
S3_BUCKET_URL_BASE=<alt-for-s3-url>
2630
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
31+
TRANSLATIONS_ENABLED=true
2732
UI_ACCESS_TOKEN_ENABLED=false
2833
UPLOAD_LIMIT=250000000
29-
MOBILE_ENABLED=true

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Check out the repo
2222
uses: actions/checkout@v2
23+
with:
24+
ref: release
2325
- name: Set up Docker Buildx
2426
uses: docker/setup-buildx-action@v1
2527
- name: Login to Docker Hub

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"tabWidth": 2,
1515
"trailingComma": "none",
1616
"useTabs": false,
17-
"quoteProps": "as-needed"
17+
"quoteProps": "as-needed",
18+
"endOfLine":"auto"
1819
}
File renamed without changes.

client/__mocks__/i18n.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { enUS, es, ja, hi } from 'date-fns/locale';
2+
import i18n from '../i18n-test';
3+
4+
export function languageKeyToLabel(lang) {
5+
const languageMap = {
6+
'en-US': 'English',
7+
'es-419': 'Español',
8+
ja: '日本語',
9+
hi: 'हिन्दी'
10+
};
11+
return languageMap[lang];
12+
}
13+
14+
export function languageKeyToDateLocale(lang) {
15+
const languageMap = {
16+
'en-US': enUS,
17+
'es-419': es,
18+
ja,
19+
hi
20+
};
21+
return languageMap[lang];
22+
}
23+
24+
export function currentDateLocale() {
25+
return languageKeyToDateLocale(i18n.language);
26+
}
27+
28+
export default i18n;

client/__mocks__/styleMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

client/components/Nav.jsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,16 @@ class Nav extends React.PureComponent {
617617
/>
618618
</button>
619619
<ul className="nav__dropdown">
620+
<li className="nav__dropdown-item">
621+
<button
622+
onFocus={this.handleFocusForLang}
623+
onBlur={this.handleBlur}
624+
value="de"
625+
onClick={(e) => this.handleLangSelection(e)}
626+
>
627+
Deutsch
628+
</button>
629+
</li>
620630
<li className="nav__dropdown-item">
621631
<button
622632
onFocus={this.handleFocusForLang}
@@ -647,6 +657,16 @@ class Nav extends React.PureComponent {
647657
Français
648658
</button>
649659
</li>
660+
<li className="nav__dropdown-item">
661+
<button
662+
onFocus={this.handleFocusForLang}
663+
onBlur={this.handleBlur}
664+
value="hi"
665+
onClick={(e) => this.handleLangSelection(e)}
666+
>
667+
हिन्दी
668+
</button>
669+
</li>
650670
<li className="nav__dropdown-item">
651671
<button
652672
onFocus={this.handleFocusForLang}
@@ -661,10 +681,10 @@ class Nav extends React.PureComponent {
661681
<button
662682
onFocus={this.handleFocusForLang}
663683
onBlur={this.handleBlur}
664-
value="hi"
684+
value="pt-BR"
665685
onClick={(e) => this.handleLangSelection(e)}
666686
>
667-
हिन्दी
687+
Português
668688
</button>
669689
</li>
670690
</ul>
@@ -877,8 +897,6 @@ Nav.propTypes = {
877897
cmController: PropTypes.shape({
878898
tidyCode: PropTypes.func,
879899
showFind: PropTypes.func,
880-
findNext: PropTypes.func,
881-
findPrev: PropTypes.func,
882900
showReplace: PropTypes.func,
883901
getContent: PropTypes.func
884902
}),

client/components/__test__/Nav.test.jsx renamed to client/components/Nav.unit.test.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
33

4-
import { NavComponent } from '../Nav';
4+
import { NavComponent } from './Nav';
5+
6+
jest.mock('../i18n');
57

68
describe('Nav', () => {
79
const props = {

client/components/useAsModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import styled from 'styled-components';
3-
import { useModalBehavior } from '../utils/custom-hooks';
3+
import { useModalBehavior } from '../modules/IDE/hooks/custom-hooks';
44

55
const BackgroundOverlay = styled.div`
66
position: fixed;

0 commit comments

Comments
 (0)