Skip to content

Commit a416905

Browse files
authored
Merge branch 'develop' into accessibility
2 parents e9225d9 + 7e4a2d2 commit a416905

Some content is hidden

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

55 files changed

+2267
-1785
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones
3838

3939
We will aim to deploy on a 1-2 month basis. Here are some dates we’re working towards:
4040

41-
2.11.0 MINOR Release: By December 22, 2023
41+
2.11.0 MINOR Release: By January 16, 2023
4242

4343
[You can read more about Semantic Versioning and the differences between a MINOR and PATCH release](https://semver.org/).
4444

client/common/Button.jsx

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const displays = {
2121
const StyledButton = styled.button`
2222
&&& {
2323
font-weight: bold;
24-
display: flex;
24+
display: ${({ display }) =>
25+
display === displays.inline ? 'inline-flex' : 'flex'};
2526
justify-content: center;
2627
align-items: center;
2728
@@ -107,57 +108,6 @@ const StyledInlineButton = styled.button`
107108
}
108109
`;
109110

110-
const StyledIconButton = styled.button`
111-
&&& {
112-
display: flex;
113-
justify-content: center;
114-
align-items: center;
115-
116-
width: ${remSize(32)}px;
117-
height: ${remSize(32)}px;
118-
text-decoration: none;
119-
120-
color: ${({ kind }) => prop(`Button.${kind}.default.foreground`)};
121-
background-color: ${({ kind }) => prop(`Button.${kind}.hover.background`)};
122-
cursor: pointer;
123-
border: 1px solid transparent;
124-
border-radius: 50%;
125-
padding: ${remSize(8)} ${remSize(25)};
126-
line-height: 1;
127-
128-
&:hover:not(:disabled) {
129-
color: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
130-
background-color: ${({ kind }) =>
131-
prop(`Button.${kind}.hover.background`)};
132-
133-
svg * {
134-
fill: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
135-
}
136-
}
137-
138-
&:active:not(:disabled) {
139-
color: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
140-
background-color: ${({ kind }) =>
141-
prop(`Button.${kind}.active.background`)};
142-
143-
svg * {
144-
fill: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
145-
}
146-
}
147-
148-
&:disabled {
149-
color: ${({ kind }) => prop(`Button.${kind}.disabled.foreground`)};
150-
background-color: ${({ kind }) =>
151-
prop(`Button.${kind}.disabled.background`)};
152-
cursor: not-allowed;
153-
}
154-
155-
> * + * {
156-
margin-left: ${remSize(8)};
157-
}
158-
}
159-
`;
160-
161111
/**
162112
* A Button performs an primary action
163113
*/
@@ -184,12 +134,8 @@ const Button = ({
184134
);
185135
let StyledComponent = StyledButton;
186136

187-
if (display === displays.inline) {
188-
StyledComponent = StyledInlineButton;
189-
}
190-
191137
if (iconOnly) {
192-
StyledComponent = StyledIconButton;
138+
StyledComponent = StyledInlineButton;
193139
}
194140

195141
if (href) {
@@ -265,7 +211,7 @@ Button.propTypes = {
265211
/**
266212
* The display type of the button—inline or block
267213
*/
268-
display: PropTypes.string,
214+
display: PropTypes.oneOf(Object.values(displays)),
269215
/**
270216
* SVG icon to place after child content
271217
*/
@@ -286,7 +232,7 @@ Button.propTypes = {
286232
* Specifying an href will use an <a> to link to the URL
287233
*/
288234
href: PropTypes.string,
289-
/*
235+
/**
290236
* An ARIA Label used for accessibility
291237
*/
292238
'aria-label': PropTypes.string,

client/common/IconButton.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const IconButton = (props) => {
1919
return (
2020
<ButtonWrapper
2121
iconBefore={icon && <Icon />}
22+
iconOnly
2223
display={Button.displays.inline}
2324
focusable="false"
2425
{...otherProps}

client/constants.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ export const CLEAR_PERSISTED_STATE = 'CLEAR_PERSISTED_STATE';
130130

131131
export const HIDE_RUNTIME_ERROR_WARNING = 'HIDE_RUNTIME_ERROR_WARNING';
132132
export const SHOW_RUNTIME_ERROR_WARNING = 'SHOW_RUNTIME_ERROR_WARNING';
133-
export const SET_ASSETS = 'SET_ASSETS';
134-
export const DELETE_ASSET = 'DELETE_ASSET';
135133

136134
export const TOGGLE_DIRECTION = 'TOGGLE_DIRECTION';
137135
export const SET_SORTING = 'SET_SORTING';

client/i18n.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717
zhTW,
1818
uk,
1919
sv,
20-
tr
20+
tr,
21+
enIN
2122
} from 'date-fns/locale';
2223

2324
const fallbackLng = ['en-US'];
@@ -37,12 +38,13 @@ export const availableLanguages = [
3738
'uk-UA',
3839
'zh-CN',
3940
'zh-TW',
40-
'tr'
41+
'tr',
42+
'ur'
4143
];
4244

4345
export function languageKeyToLabel(lang) {
4446
const languageMap = {
45-
be: 'Bengali',
47+
be: 'বাংলা',
4648
de: 'Deutsch',
4749
'en-US': 'English',
4850
'es-419': 'Español',
@@ -56,7 +58,8 @@ export function languageKeyToLabel(lang) {
5658
'uk-UA': 'Українська',
5759
'zh-CN': '简体中文',
5860
'zh-TW': '正體中文',
59-
tr: 'Türkçe'
61+
tr: 'Türkçe',
62+
ur: 'اردو'
6063
};
6164
return languageMap[lang];
6265
}
@@ -77,7 +80,8 @@ export function languageKeyToDateLocale(lang) {
7780
'uk-UA': uk,
7881
'zh-CN': zhCN,
7982
'zh-TW': zhTW,
80-
tr
83+
tr,
84+
ur: enIN
8185
};
8286
return languageMap[lang];
8387
}

client/middleware.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createListenerMiddleware } from '@reduxjs/toolkit';
2+
3+
const listenerMiddleware = createListenerMiddleware();
4+
5+
export default listenerMiddleware;

client/modules/App/App.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
22
import React, { useEffect, useRef, useState } from 'react';
33
import { useDispatch, useSelector } from 'react-redux';
44
import { useLocation } from 'react-router-dom';
5-
import getConfig from '../../utils/getConfig';
5+
import { showReduxDevTools } from '../../store';
66
import DevTools from './components/DevTools';
77
import { setPreviousPath } from '../IDE/actions/ide';
88
import { setLanguage } from '../IDE/actions/preferences';
@@ -52,9 +52,7 @@ const App = ({ children }) => {
5252
return (
5353
<div className="app">
5454
<CookieConsent hide={hide} />
55-
{isMounted &&
56-
!window.devToolsExtension &&
57-
getConfig('NODE_ENV') === 'development' && <DevTools />}
55+
{isMounted && showReduxDevTools() && <DevTools />}
5856
{children}
5957
</div>
6058
);

client/modules/IDE/actions/assets.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import apiClient from '../../../utils/apiClient';
22
import * as ActionTypes from '../../../constants';
33
import { startLoader, stopLoader } from './loader';
4+
import { assetsActions } from '../reducers/assets';
45

5-
function setAssets(assets, totalSize) {
6-
return {
7-
type: ActionTypes.SET_ASSETS,
8-
assets,
9-
totalSize
10-
};
11-
}
6+
const { setAssets, deleteAsset } = assetsActions;
127

138
export function getAssets() {
149
return async (dispatch) => {
1510
dispatch(startLoader());
1611
try {
1712
const response = await apiClient.get('/S3/objects');
18-
dispatch(setAssets(response.data.assets, response.data.totalSize));
13+
14+
const assetData = {
15+
assets: response.data.assets,
16+
totalSize: response.data.totalSize
17+
};
18+
19+
dispatch(setAssets(assetData));
1920
dispatch(stopLoader());
2021
} catch (error) {
2122
dispatch({
@@ -26,13 +27,6 @@ export function getAssets() {
2627
};
2728
}
2829

29-
export function deleteAsset(assetKey) {
30-
return {
31-
type: ActionTypes.DELETE_ASSET,
32-
key: assetKey
33-
};
34-
}
35-
3630
export function deleteAssetRequest(assetKey) {
3731
return async (dispatch) => {
3832
try {

client/modules/IDE/actions/collections.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { setToastText, showToast } from './toast';
66

77
const TOAST_DISPLAY_TIME_MS = 1500;
88

9-
// eslint-disable-next-line
109
export function getCollections(username) {
1110
return (dispatch) => {
1211
dispatch(startLoader());
@@ -16,8 +15,7 @@ export function getCollections(username) {
1615
} else {
1716
url = '/collections';
1817
}
19-
console.log(url);
20-
apiClient
18+
return apiClient
2119
.get(url)
2220
.then((response) => {
2321
dispatch({

client/modules/IDE/components/About.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function About(props) {
2828
/>
2929
<div className="about__content-column">
3030
<p className="about__version-info">
31-
Web Editor: <span>v{packageData?.version}</span>
31+
{t('About.WebEditor')}: <span>v{packageData?.version}</span>
3232
</p>
3333
<p className="about__version-info">
3434
p5.js: <span>v{p5version}</span>
@@ -44,7 +44,7 @@ function About(props) {
4444
aria-hidden="true"
4545
focusable="false"
4646
/>
47-
Home
47+
{t('About.Home')}
4848
</a>
4949
</p>
5050
<p className="about__content-column-list">
@@ -86,7 +86,7 @@ function About(props) {
8686
aria-hidden="true"
8787
focusable="false"
8888
/>
89-
Twitter
89+
{t('About.Twitter')}
9090
</a>
9191
</p>
9292
<p className="about__content-column-list">
@@ -100,7 +100,7 @@ function About(props) {
100100
aria-hidden="true"
101101
focusable="false"
102102
/>
103-
Instagram
103+
{t('About.Instagram')}
104104
</a>
105105
</p>
106106
</div>
@@ -159,7 +159,7 @@ function About(props) {
159159
aria-hidden="true"
160160
focusable="false"
161161
/>
162-
Discord
162+
{t('About.Discord')}
163163
</a>
164164
</p>
165165
<p className="about__content-column-list">

0 commit comments

Comments
 (0)