Skip to content

Commit 10a653c

Browse files
authored
Merge branch 'develop' into navbar-dropdown
2 parents 78799d3 + 4f9b6ca commit 10a653c

File tree

83 files changed

+5637
-2184
lines changed

Some content is hidden

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

83 files changed

+5637
-2184
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ If you have found a bug in the p5.js Web Editor, you can file it under the ["iss
3131

3232
To see which pull requests and issues are currently being reviewed, check the [PR Review Board](https://github.com/processing/p5.js-web-editor/projects/9) or the following Milestones: [MINOR Release](https://github.com/processing/p5.js-web-editor/milestone/8).
3333

34-
Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones will be prioritized since they are planned to be merged for the next release to Production. Please feel free to [comment on this pinned issue](https://github.com/processing/p5.js-web-editor/issues/2534) if you would like your issue to be considered for the next release!
35-
36-
37-
### When Will the Next Production Release Be?
38-
39-
We will aim to deploy on a 1-2 month basis. Here are some dates we’re working towards:
40-
41-
2.11.0 MINOR Release: By January 16, 2023
42-
43-
[You can read more about Semantic Versioning and the differences between a MINOR and PATCH release](https://semver.org/).
44-
4534

4635
## References for Contributing to the p5.js Web Editor
4736

client/components/AddRemoveButton.jsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

client/components/Dropdown/TableDropdown.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import React from 'react';
2-
import { useMediaQuery } from 'react-responsive';
32
import styled from 'styled-components';
43
import { prop, remSize } from '../../theme';
54
import DropdownMenu from './DropdownMenu';
65

76
import DownFilledTriangleIcon from '../../images/down-filled-triangle.svg';
87
import MoreIconSvg from '../../images/more.svg';
8+
import useIsMobile from '../../modules/IDE/hooks/useIsMobile';
99

1010
const DotsHorizontal = styled(MoreIconSvg)`
1111
transform: rotate(90deg);
1212
`;
1313

1414
const TableDropdownIcon = () => {
15-
// TODO: centralize breakpoints
16-
const isMobile = useMediaQuery({ maxWidth: 770 });
17-
15+
const isMobile = useIsMobile();
1816
return isMobile ? (
1917
<DotsHorizontal focusable="false" aria-hidden="true" />
2018
) : (

client/components/NavBasic.jsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

client/components/OverlayManager.jsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

client/constants.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// multiple files
33
export const UPDATE_FILE_CONTENT = 'UPDATE_FILE_CONTENT';
44
export const TOGGLE_SKETCH = 'TOGGLE_SKETCH';
5-
65
export const START_SKETCH = 'START_SKETCH';
76
export const STOP_SKETCH = 'STOP_SKETCH';
87

@@ -137,9 +136,6 @@ export const SET_SORT_PARAMS = 'SET_SORT_PARAMS';
137136
export const SET_SEARCH_TERM = 'SET_SEARCH_TERM';
138137
export const CLOSE_SKETCHLIST_MODAL = 'CLOSE_SKETCHLIST_MODAL';
139138

140-
export const START_LOADING = 'START_LOADING';
141-
export const STOP_LOADING = 'STOP_LOADING';
142-
143139
export const START_SAVING_PROJECT = 'START_SAVING_PROJECT';
144140
export const END_SAVING_PROJECT = 'END_SAVING_PROJECT';
145141

client/i18n-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
3-
43
import translations from '../translations/locales/en-US/translations.json';
54

65
i18n.use(initReactI18next).init({
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { connect } from 'react-redux';
3+
import { useSelector } from 'react-redux';
44
import { ThemeProvider } from 'styled-components';
5+
import theme from '../../../theme';
56

6-
import theme, { Theme } from '../../../theme';
7-
8-
const Provider = ({ children, currentTheme }) => (
9-
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider>
10-
);
7+
const Provider = ({ children }) => {
8+
const currentTheme = useSelector((state) => state.preferences.theme);
9+
return (
10+
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider>
11+
);
12+
};
1113

1214
Provider.propTypes = {
13-
children: PropTypes.node.isRequired,
14-
currentTheme: PropTypes.oneOf(Object.keys(Theme)).isRequired
15+
children: PropTypes.node.isRequired
1516
};
1617

17-
function mapStateToProps(state) {
18-
return {
19-
currentTheme: state.preferences.theme
20-
};
21-
}
22-
23-
export default connect(mapStateToProps)(Provider);
18+
export default Provider;

client/modules/IDE/actions/assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import apiClient from '../../../utils/apiClient';
22
import * as ActionTypes from '../../../constants';
3-
import { startLoader, stopLoader } from './loader';
3+
import { startLoader, stopLoader } from '../reducers/loading';
44
import { assetsActions } from '../reducers/assets';
55

66
const { setAssets, deleteAsset } = assetsActions;

client/modules/IDE/actions/collections.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import browserHistory from '../../../browserHistory';
22
import apiClient from '../../../utils/apiClient';
33
import * as ActionTypes from '../../../constants';
4-
import { startLoader, stopLoader } from './loader';
4+
import { startLoader, stopLoader } from '../reducers/loading';
55
import { setToastText, showToast } from './toast';
66

77
const TOAST_DISPLAY_TIME_MS = 1500;
@@ -80,7 +80,7 @@ export function addToCollection(collectionId, projectId) {
8080

8181
const collectionName = response.data.name;
8282

83-
dispatch(setToastText(`Added to "${collectionName}`));
83+
dispatch(setToastText(`Added to "${collectionName}"`));
8484
dispatch(showToast(TOAST_DISPLAY_TIME_MS));
8585

8686
return response.data;
@@ -110,7 +110,7 @@ export function removeFromCollection(collectionId, projectId) {
110110

111111
const collectionName = response.data.name;
112112

113-
dispatch(setToastText(`Removed from "${collectionName}`));
113+
dispatch(setToastText(`Removed from "${collectionName}"`));
114114
dispatch(showToast(TOAST_DISPLAY_TIME_MS));
115115

116116
return response.data;

client/modules/IDE/actions/loader.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

client/modules/IDE/actions/projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import apiClient from '../../../utils/apiClient';
22
import * as ActionTypes from '../../../constants';
3-
import { startLoader, stopLoader } from './loader';
3+
import { startLoader, stopLoader } from '../reducers/loading';
44

55
// eslint-disable-next-line
66
export function getProjects(username) {

client/modules/IDE/actions/projects.unit.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { rest } from 'msw';
55

66
import * as ProjectActions from './projects';
77
import * as ActionTypes from '../../../constants';
8+
import { startLoader, stopLoader } from '../reducers/loading';
89
import {
910
initialTestState,
1011
mockProjects
@@ -33,9 +34,9 @@ describe('projects action creator tests', () => {
3334
store = mockStore(initialTestState);
3435

3536
const expectedActions = [
36-
{ type: ActionTypes.START_LOADING },
37+
{ type: startLoader.type },
3738
{ type: ActionTypes.SET_PROJECTS, projects: mockProjects },
38-
{ type: ActionTypes.STOP_LOADING }
39+
{ type: stopLoader.type }
3940
];
4041

4142
return store

client/modules/IDE/components/About.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,20 @@ function About(props) {
162162
{t('About.Discord')}
163163
</a>
164164
</p>
165+
<p className="about__content-column-list">
166+
<a
167+
href="https://p5js.org/download/support.html"
168+
target="_blank"
169+
rel="noopener noreferrer"
170+
>
171+
<AsteriskIcon
172+
className="about__content-column-asterisk"
173+
aria-hidden="true"
174+
focusable="false"
175+
/>
176+
Donate
177+
</a>
178+
</p>
165179
<p className="about__content-column-list">
166180
<Link to="/privacy-policy">
167181
<AsteriskIcon

client/modules/IDE/components/EditableInput.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ function EditableInput({
2828
const { t } = useTranslation();
2929
React.useEffect(() => {
3030
if (isEditing) {
31-
inputRef.current?.focus();
31+
const inputElement = inputRef.current;
32+
inputElement.setSelectionRange(
33+
inputElement.value.length,
34+
inputElement.value.length
35+
);
36+
inputElement.focus();
3237
}
3338
}, [isEditing]);
3439
React.useEffect(() => {

client/modules/IDE/components/Editor/MobileEditor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const EditorContainer = styled.div`
99
transform: ${(props) =>
1010
props.expanded ? 'translateX(50%)' : 'translateX(0)'};
1111
12-
> header {
12+
> div {
1313
display: flex;
1414
${prop('MobilePanel.secondary')}
1515
> span {

client/modules/IDE/components/Editor/index.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ class Editor extends React.Component {
208208
if (/^[a-z]$/i.test(e.key) && (mode === 'css' || mode === 'javascript')) {
209209
this.showHint(_cm);
210210
}
211+
if (e.key === 'Escape') {
212+
e.preventDefault();
213+
this._cm.getInputField().blur();
214+
}
211215
});
212216

213217
this._cm.getWrapperElement().style[
@@ -338,7 +342,7 @@ class Editor extends React.Component {
338342
mode = 'application/json';
339343
} else if (fileName.match(/.+\.(frag|glsl)$/i)) {
340344
mode = 'x-shader/x-fragment';
341-
} else if (fileName.match(/.+\.(vert|stl)$/i)) {
345+
} else if (fileName.match(/.+\.(vert|stl|mtl)$/i)) {
342346
mode = 'x-shader/x-vertex';
343347
} else {
344348
mode = 'text/plain';
@@ -513,7 +517,7 @@ class Editor extends React.Component {
513517
{(matches) =>
514518
matches ? (
515519
<section className={editorSectionClass}>
516-
<header className="editor__header">
520+
<div className="editor__header">
517521
<button
518522
aria-label={this.props.t('Editor.OpenSketchARIA')}
519523
className="sidebar__contract"
@@ -538,7 +542,7 @@ class Editor extends React.Component {
538542
</span>
539543
<Timer />
540544
</div>
541-
</header>
545+
</div>
542546
<article
543547
ref={(element) => {
544548
this.codemirrorContainer = element;
@@ -555,7 +559,7 @@ class Editor extends React.Component {
555559
</section>
556560
) : (
557561
<EditorContainer expanded={this.props.isExpanded}>
558-
<header>
562+
<>
559563
<IconButton
560564
onClick={this.props.expandSidebar}
561565
icon={FolderIcon}
@@ -564,7 +568,7 @@ class Editor extends React.Component {
564568
{this.props.file.name}
565569
<UnsavedChangesIndicator />
566570
</span>
567-
</header>
571+
</>
568572
<section>
569573
<EditorHolder
570574
ref={(element) => {

0 commit comments

Comments
 (0)