Skip to content

Commit

Permalink
Merge branch 'develop' into navbar-dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
raclim authored Jun 5, 2024
2 parents 78799d3 + 4f9b6ca commit 10a653c
Show file tree
Hide file tree
Showing 83 changed files with 5,637 additions and 2,184 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ If you have found a bug in the p5.js Web Editor, you can file it under the ["iss

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).

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!


### When Will the Next Production Release Be?

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

2.11.0 MINOR Release: By January 16, 2023

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


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

Expand Down
32 changes: 0 additions & 32 deletions client/components/AddRemoveButton.jsx

This file was deleted.

6 changes: 2 additions & 4 deletions client/components/Dropdown/TableDropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React from 'react';
import { useMediaQuery } from 'react-responsive';
import styled from 'styled-components';
import { prop, remSize } from '../../theme';
import DropdownMenu from './DropdownMenu';

import DownFilledTriangleIcon from '../../images/down-filled-triangle.svg';
import MoreIconSvg from '../../images/more.svg';
import useIsMobile from '../../modules/IDE/hooks/useIsMobile';

const DotsHorizontal = styled(MoreIconSvg)`
transform: rotate(90deg);
`;

const TableDropdownIcon = () => {
// TODO: centralize breakpoints
const isMobile = useMediaQuery({ maxWidth: 770 });

const isMobile = useIsMobile();
return isMobile ? (
<DotsHorizontal focusable="false" aria-hidden="true" />
) : (
Expand Down
52 changes: 0 additions & 52 deletions client/components/NavBasic.jsx

This file was deleted.

26 changes: 0 additions & 26 deletions client/components/OverlayManager.jsx

This file was deleted.

4 changes: 0 additions & 4 deletions client/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// multiple files
export const UPDATE_FILE_CONTENT = 'UPDATE_FILE_CONTENT';
export const TOGGLE_SKETCH = 'TOGGLE_SKETCH';

export const START_SKETCH = 'START_SKETCH';
export const STOP_SKETCH = 'STOP_SKETCH';

Expand Down Expand Up @@ -137,9 +136,6 @@ export const SET_SORT_PARAMS = 'SET_SORT_PARAMS';
export const SET_SEARCH_TERM = 'SET_SEARCH_TERM';
export const CLOSE_SKETCHLIST_MODAL = 'CLOSE_SKETCHLIST_MODAL';

export const START_LOADING = 'START_LOADING';
export const STOP_LOADING = 'STOP_LOADING';

export const START_SAVING_PROJECT = 'START_SAVING_PROJECT';
export const END_SAVING_PROJECT = 'END_SAVING_PROJECT';

Expand Down
1 change: 0 additions & 1 deletion client/i18n-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

import translations from '../translations/locales/en-US/translations.json';

i18n.use(initReactI18next).init({
Expand Down
25 changes: 10 additions & 15 deletions client/modules/App/components/ThemeProvider.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { useSelector } from 'react-redux';
import { ThemeProvider } from 'styled-components';
import theme from '../../../theme';

import theme, { Theme } from '../../../theme';

const Provider = ({ children, currentTheme }) => (
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider>
);
const Provider = ({ children }) => {
const currentTheme = useSelector((state) => state.preferences.theme);
return (
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider>
);
};

Provider.propTypes = {
children: PropTypes.node.isRequired,
currentTheme: PropTypes.oneOf(Object.keys(Theme)).isRequired
children: PropTypes.node.isRequired
};

function mapStateToProps(state) {
return {
currentTheme: state.preferences.theme
};
}

export default connect(mapStateToProps)(Provider);
export default Provider;
2 changes: 1 addition & 1 deletion client/modules/IDE/actions/assets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import apiClient from '../../../utils/apiClient';
import * as ActionTypes from '../../../constants';
import { startLoader, stopLoader } from './loader';
import { startLoader, stopLoader } from '../reducers/loading';
import { assetsActions } from '../reducers/assets';

const { setAssets, deleteAsset } = assetsActions;
Expand Down
6 changes: 3 additions & 3 deletions client/modules/IDE/actions/collections.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import browserHistory from '../../../browserHistory';
import apiClient from '../../../utils/apiClient';
import * as ActionTypes from '../../../constants';
import { startLoader, stopLoader } from './loader';
import { startLoader, stopLoader } from '../reducers/loading';
import { setToastText, showToast } from './toast';

const TOAST_DISPLAY_TIME_MS = 1500;
Expand Down Expand Up @@ -80,7 +80,7 @@ export function addToCollection(collectionId, projectId) {

const collectionName = response.data.name;

dispatch(setToastText(`Added to "${collectionName}`));
dispatch(setToastText(`Added to "${collectionName}"`));
dispatch(showToast(TOAST_DISPLAY_TIME_MS));

return response.data;
Expand Down Expand Up @@ -110,7 +110,7 @@ export function removeFromCollection(collectionId, projectId) {

const collectionName = response.data.name;

dispatch(setToastText(`Removed from "${collectionName}`));
dispatch(setToastText(`Removed from "${collectionName}"`));
dispatch(showToast(TOAST_DISPLAY_TIME_MS));

return response.data;
Expand Down
9 changes: 0 additions & 9 deletions client/modules/IDE/actions/loader.js

This file was deleted.

2 changes: 1 addition & 1 deletion client/modules/IDE/actions/projects.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import apiClient from '../../../utils/apiClient';
import * as ActionTypes from '../../../constants';
import { startLoader, stopLoader } from './loader';
import { startLoader, stopLoader } from '../reducers/loading';

// eslint-disable-next-line
export function getProjects(username) {
Expand Down
5 changes: 3 additions & 2 deletions client/modules/IDE/actions/projects.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { rest } from 'msw';

import * as ProjectActions from './projects';
import * as ActionTypes from '../../../constants';
import { startLoader, stopLoader } from '../reducers/loading';
import {
initialTestState,
mockProjects
Expand Down Expand Up @@ -33,9 +34,9 @@ describe('projects action creator tests', () => {
store = mockStore(initialTestState);

const expectedActions = [
{ type: ActionTypes.START_LOADING },
{ type: startLoader.type },
{ type: ActionTypes.SET_PROJECTS, projects: mockProjects },
{ type: ActionTypes.STOP_LOADING }
{ type: stopLoader.type }
];

return store
Expand Down
14 changes: 14 additions & 0 deletions client/modules/IDE/components/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ function About(props) {
{t('About.Discord')}
</a>
</p>
<p className="about__content-column-list">
<a
href="https://p5js.org/download/support.html"
target="_blank"
rel="noopener noreferrer"
>
<AsteriskIcon
className="about__content-column-asterisk"
aria-hidden="true"
focusable="false"
/>
Donate
</a>
</p>
<p className="about__content-column-list">
<Link to="/privacy-policy">
<AsteriskIcon
Expand Down
7 changes: 6 additions & 1 deletion client/modules/IDE/components/EditableInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ function EditableInput({
const { t } = useTranslation();
React.useEffect(() => {
if (isEditing) {
inputRef.current?.focus();
const inputElement = inputRef.current;
inputElement.setSelectionRange(
inputElement.value.length,
inputElement.value.length
);
inputElement.focus();
}
}, [isEditing]);
React.useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/IDE/components/Editor/MobileEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const EditorContainer = styled.div`
transform: ${(props) =>
props.expanded ? 'translateX(50%)' : 'translateX(0)'};
> header {
> div {
display: flex;
${prop('MobilePanel.secondary')}
> span {
Expand Down
14 changes: 9 additions & 5 deletions client/modules/IDE/components/Editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ class Editor extends React.Component {
if (/^[a-z]$/i.test(e.key) && (mode === 'css' || mode === 'javascript')) {
this.showHint(_cm);
}
if (e.key === 'Escape') {
e.preventDefault();
this._cm.getInputField().blur();
}
});

this._cm.getWrapperElement().style[
Expand Down Expand Up @@ -338,7 +342,7 @@ class Editor extends React.Component {
mode = 'application/json';
} else if (fileName.match(/.+\.(frag|glsl)$/i)) {
mode = 'x-shader/x-fragment';
} else if (fileName.match(/.+\.(vert|stl)$/i)) {
} else if (fileName.match(/.+\.(vert|stl|mtl)$/i)) {
mode = 'x-shader/x-vertex';
} else {
mode = 'text/plain';
Expand Down Expand Up @@ -513,7 +517,7 @@ class Editor extends React.Component {
{(matches) =>
matches ? (
<section className={editorSectionClass}>
<header className="editor__header">
<div className="editor__header">
<button
aria-label={this.props.t('Editor.OpenSketchARIA')}
className="sidebar__contract"
Expand All @@ -538,7 +542,7 @@ class Editor extends React.Component {
</span>
<Timer />
</div>
</header>
</div>
<article
ref={(element) => {
this.codemirrorContainer = element;
Expand All @@ -555,7 +559,7 @@ class Editor extends React.Component {
</section>
) : (
<EditorContainer expanded={this.props.isExpanded}>
<header>
<>
<IconButton
onClick={this.props.expandSidebar}
icon={FolderIcon}
Expand All @@ -564,7 +568,7 @@ class Editor extends React.Component {
{this.props.file.name}
<UnsavedChangesIndicator />
</span>
</header>
</>
<section>
<EditorHolder
ref={(element) => {
Expand Down
Loading

0 comments on commit 10a653c

Please sign in to comment.