Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6a632a2
Merge branch 'release-2.15.1' into release
raclim Nov 5, 2024
686f9e5
Merge branch 'release-2.15.2' into release
raclim Nov 7, 2024
d95f4ed
Merge branch 'release-2.15.3' into release
raclim Nov 18, 2024
11be62c
Merge branch 'release-2.15.4' into release
raclim Dec 3, 2024
2cb97be
Merge branch 'release-2.15.5' into release
raclim Dec 3, 2024
6fa1ea4
Merge branch 'release-2.15.6' into release
raclim Dec 5, 2024
1e752f9
Merge branch 'release-2.15.7' into release
raclim Jan 23, 2025
e1ab16d
Merge branch 'release-2.15.8' into release
raclim Mar 7, 2025
41a728a
Merge branch 'release-2.15.9' into release
raclim Apr 2, 2025
763521a
Merge branch 'release-2.16.0' into release
raclim Apr 17, 2025
9248a4b
Merge branch 'release-2.16.1' into release
raclim Apr 17, 2025
4457ff6
Merge branch 'release-2.16.2' into release
raclim Apr 18, 2025
eb5abb6
Merge branch 'release-2.16.3' into release
raclim Apr 29, 2025
7a131ee
Merge branch 'release-2.16.4' into release
raclim May 16, 2025
ccb7575
Merge branch 'release-2.16.5' into release
raclim May 30, 2025
ac38225
Merge branch 'release-2.16.6' into release
raclim Jun 10, 2025
6cf1d35
Merge branch 'release-2.16.7' into release
raclim Jun 13, 2025
01fa2a7
temp esc editor key, update open/close file menu aria label
raclim Jun 27, 2025
90c92f5
Merge pull request #3528 from processing/vpat-updates-2
raclim Jun 27, 2025
5c620f4
2.16.8
raclim Jun 27, 2025
39b70a7
Merge branch 'release-2.16.8' into release
raclim Jun 27, 2025
3bc60de
Merge branch 'release-2.16.8' into develop
raclim Jun 27, 2025
c4726f6
Merge branch 'release' into develop
raclim Jul 1, 2025
648b3a2
add banner component to IDE View
raclim Jul 2, 2025
8828885
add styling for banner
raclim Jul 2, 2025
8205d51
Merge pull request #3531 from processing/curation-banner
raclim Jul 2, 2025
c440b8f
2.16.9
raclim Jul 2, 2025
ec0d4e9
Merge branch 'release-2.16.9' into release
raclim Jul 2, 2025
695a87e
Merge branch 'release-2.16.9' into develop
raclim Jul 2, 2025
74e6a84
Merge branch 'release' into develop
raclim Jul 2, 2025
5ed4faf
update banner text
raclim Jul 2, 2025
2c3a6e1
set default color on hover for banner link
raclim Jul 2, 2025
9c2d0e2
update icon styling
raclim Jul 2, 2025
00e8c00
update nav snapshots
raclim Jul 2, 2025
ae6a0ca
Merge pull request #3532 from processing/banner-fixes
raclim Jul 2, 2025
b149021
remove lint warning
raclim Jul 2, 2025
3755844
2.16.10
raclim Jul 2, 2025
c0b70b1
Merge branch 'release-2.16.10' into release
raclim Jul 2, 2025
099f4f3
Merge branch 'release-2.16.10' into develop
raclim Jul 2, 2025
e8bdb3b
Merge branch 'release' into develop
raclim Jul 2, 2025
7de0f7a
install typescript 5.8.3
clairep94 Jul 6, 2025
7420fd1
install compatible react types for react 16.14
clairep94 Jul 6, 2025
82973eb
install babel preset-typescript
clairep94 Jul 6, 2025
a105e23
move typescript from deps to dev deps
clairep94 Jul 6, 2025
85d94d6
install node types for node 16
clairep94 Jul 6, 2025
088a38e
set up babel rc
clairep94 Jul 6, 2025
cfcd17b
webpack setup
clairep94 Jul 6, 2025
c44ab95
test lint-staged add ts tsx
clairep94 Jul 6, 2025
e7bf1fb
jest typescript dep
clairep94 Jul 6, 2025
8ebec3a
storybook update included stories
clairep94 Jul 6, 2025
012fefe
set up eslint deps and eslintrc
clairep94 Jul 6, 2025
a5cdbec
update es lint commands manually tested
clairep94 Jul 7, 2025
fa92de3
add ts config for client with ts check
clairep94 Jul 7, 2025
14aa861
add correct eslint version
clairep94 Jul 7, 2025
5c88395
update resolve on config.examples
clairep94 Jul 7, 2025
8c2baeb
add precommit check
clairep94 Jul 7, 2025
198622b
move typecheck to pre-push
clairep94 Jul 7, 2025
116de80
remove pre-commit typecheck, need to discuss
clairep94 Jul 7, 2025
2cb394a
fix typo on webpack config example
clairep94 Jul 7, 2025
24f4e74
update deadline for curation
raclim Jul 8, 2025
3d9674d
Merge pull request #3535 from processing/update-banner
raclim Jul 8, 2025
011f968
2.16.11
raclim Jul 8, 2025
fb28270
Merge branch 'release-2.16.11' into release
raclim Jul 8, 2025
734ba39
Merge branch 'release-2.16.11' into develop
raclim Jul 8, 2025
2b41306
Merge branch 'release' into develop
raclim Jul 8, 2025
760cf05
Merge branch 'develop' into claire/pr05/set_up_ts_dependencies
clairep94 Jul 8, 2025
65bce4b
fix: typo in "why write tests" section
Izzy-Snyder Jul 15, 2025
f381dea
Merge pull request #3539 from Izzy-Snyder/issue-doc-typo-fix
raclim Jul 15, 2025
9330d34
Merge branch 'develop' into claire/pr05/set_up_ts_dependencies
clairep94 Jul 15, 2025
3eed8b8
add ts config settings suggested by typescript docs for babel & tsc c…
clairep94 Jul 15, 2025
0ff68ea
add base tsconfig and update client to extend from base
clairep94 Jul 15, 2025
53ad7a1
test moving typecheck to only lint-staged files, should pass as forma…
clairep94 Jul 15, 2025
67f99ac
update lint-staged command order
clairep94 Jul 15, 2025
d9c7252
remove build info
clairep94 Jul 15, 2025
69410ad
add *.tsbuildinfo to git ignore
clairep94 Jul 15, 2025
963b59a
fix, can't use staging files only while specifying a tscoonfig project
clairep94 Jul 15, 2025
1ecafb3
fix typo
clairep94 Jul 17, 2025
1a4df6c
Merge pull request #3533 from clairep94/claire/pr05/set_up_ts_depende…
raclim Jul 21, 2025
09fb469
set banner display state to false
raclim Jul 21, 2025
25e3429
Merge pull request #3548 from processing/remove-banner
raclim Jul 21, 2025
a8833de
Bump version to 2.16.12
raclim Jul 21, 2025
7008088
Merge branch 'release-2.16.12' into release
raclim Jul 21, 2025
663c785
Merge branch 'release-2.16.12' into develop
raclim Jul 21, 2025
a41c1b7
Merge branch 'release' into develop
raclim Jul 21, 2025
ea39d0e
implement jump to definition basic functionality
kammeows Jul 22, 2025
a627fde
Merge branch 'Branch_Kamakshi' of https://github.com/kammeows/p5.js-w…
kammeows Jul 24, 2025
990712a
Merge branch 'develop' into Branch_Kamakshi
kammeows Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"presets": [
"@babel/preset-react",
"@babel/preset-env"
"@babel/preset-env",
"@babel/preset-typescript"
],
"env": {
"production": {
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@
},
"overrides": [
{
"files": ["*.stories.jsx"],
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"]
},
{
"files": ["*.stories.@(js|jsx|ts|tsx)"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ terraform/.terraform/
storybook-static
duplicates.json

coverage
coverage

*.tsbuildinfo
16 changes: 8 additions & 8 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ['../client/**/*.stories.(jsx|mdx)'],
stories: ['../client/**/*.stories.(jsx|mdx|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand All @@ -18,19 +18,19 @@ const config = {
// https://storybook.js.org/docs/react/builders/webpack
// this modifies the existing image rule to exclude .svg files
// since we want to handle those files with @svgr/webpack
const imageRule = config.module.rules.find(rule => rule.test.test('.svg'))
imageRule.exclude = /\.svg$/
const imageRule = config.module.rules.find((rule) =>
rule.test.test('.svg')
);
imageRule.exclude = /\.svg$/;

// configure .svg files to be loaded with @svgr/webpack
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack']
})
});

return config
},
return config;
}
};

export default config;


9 changes: 4 additions & 5 deletions client/common/icons.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { prop } from '../theme';
import SortArrowUp from '../images/sort-arrow-up.svg';
import SortArrowDown from '../images/sort-arrow-down.svg';
import Github from '../images/github.svg';
Expand Down Expand Up @@ -35,20 +34,20 @@ import Copy from '../images/copy.svg';
function withLabel(SvgComponent) {
const StyledIcon = styled(SvgComponent)`
&&& {
color: ${prop('Icon.default')};
color: ${(props) => props.Icon?.default};
& g,
& path,
& polygon {
opacity: 1;
fill: ${prop('Icon.default')};
fill: ${(props) => props.Icon?.default};
}
&:hover {
color: ${prop('Icon.hover')};
color: ${(props) => props.Icon?.hover};
& g,
& path,
& polygon {
opacity: 1;
fill: ${prop('Icon.hover')};
fill: ${(props) => props.Icon?.hover};
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/images/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions client/modules/IDE/components/Banner.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import PropTypes from 'prop-types';
import { CrossIcon } from '../../../common/icons';

/**
* Banner displays a dismissible announcement bar with a link and a close icon.
* It's typically used to highlight opportunities, but use and design can be flexible.
*
* This component is **presentational only** — visibility logic (open/close state) should be
* controlled by the parent via the `onClose` handler.
*
* @param {Object} props
* @param {function} props.onClose - Function called when the user clicks the close (✕) button
* @returns {JSX.Element} The banner component with a call-to-action link and a close button
*
* @example
* const [showBanner, setShowBanner] = useState(true);
*
* {showBanner && (
* <Banner onClose={() => setShowBanner(false)} />
* )}
*/

const Banner = ({ onClose }) => {
// URL can be updated depending on the opportunity or announcement.
const bannerURL = 'https://openprocessing.org/curation/89576';
const bannerCopy = (
<>
We’re accepting p5.js sketches for a special curation exploring mental
health and the newest features in p5.js 2.0!{' '}
<span style={{ fontWeight: 600 }}>Submit by July 20!</span>
</>
);

return (
<div className="banner">
<a href={bannerURL}>{bannerCopy}</a>
<button className="banner-close-button" onClick={onClose}>
<CrossIcon Icon={{ default: '#000', hover: '#333' }} />
</button>
</div>
);
};

Banner.propTypes = {
onClose: PropTypes.func.isRequired
};

export default Banner;
18 changes: 16 additions & 2 deletions client/modules/IDE/components/Editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import IconButton from '../../../../common/IconButton';
import contextAwareHinter from '../contextAwareHinter';
import showRenameDialog from '../showRenameDialog';
import { handleRename } from '../rename-variable';
import { jumpToDefinition } from '../jump-to-definition';

emmet(CodeMirror);

Expand Down Expand Up @@ -158,6 +159,16 @@ class Editor extends React.Component {

delete this._cm.options.lint.options.errors;

this._cm.getWrapperElement().addEventListener('click', (e) => {
const isMac = /Mac/.test(navigator.platform);
const isCtrlClick = isMac ? e.metaKey : e.ctrlKey;

if (isCtrlClick) {
const pos = this._cm.coordsChar({ left: e.clientX, top: e.clientY });
jumpToDefinition.call(this, pos);
}
});

const replaceCommand =
metaKey === 'Ctrl' ? `${metaKey}-H` : `${metaKey}-Option-F`;
this._cm.setOption('extraKeys', {
Expand All @@ -173,6 +184,9 @@ class Editor extends React.Component {
},
Enter: 'emmetInsertLineBreak',
Esc: 'emmetResetAbbreviation',
[`Shift-${metaKey}-E`]: (cm) => {
cm.getInputField().blur();
},
F2: (cm) => this.renameVariable(cm),
[`Shift-Tab`]: false,
[`${metaKey}-Enter`]: () => null,
Expand Down Expand Up @@ -591,7 +605,7 @@ class Editor extends React.Component {
<section className={editorSectionClass}>
<div className="editor__header">
<button
aria-label={this.props.t('Editor.OpenSketchARIA')}
aria-label={this.props.t('Editor.CloseSketchARIA')}
className="sidebar__contract"
onClick={() => {
this.props.collapseSidebar();
Expand All @@ -601,7 +615,7 @@ class Editor extends React.Component {
<LeftArrowIcon focusable="false" aria-hidden="true" />
</button>
<button
aria-label={this.props.t('Editor.CloseSketchARIA')}
aria-label={this.props.t('Editor.OpenSketchARIA')}
className="sidebar__expand"
onClick={this.props.expandSidebar}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
focusable="false"
/>
</button>
Expand All @@ -351,7 +351,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
focusable="false"
/>
</button>
Expand Down Expand Up @@ -930,7 +930,7 @@ exports[`Nav renders editor version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
focusable="false"
/>
</button>
Expand All @@ -946,7 +946,7 @@ exports[`Nav renders editor version for mobile 1`] = `
>
<test-file-stub
aria-hidden="true"
classname="icons__StyledIcon-sc-xmer15-0 dStXqm"
classname="icons__StyledIcon-sc-xmer15-0 kjSZIe"
focusable="false"
/>
</button>
Expand Down
82 changes: 82 additions & 0 deletions client/modules/IDE/components/jump-to-definition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* eslint-disable */
import parseCodeVariables from './parseCodeVariables';
import { getAST, getContext } from './rename-variable';
const traverse = require('@babel/traverse').default;

export function jumpToDefinition(pos) {
const cm = this._cm;
const token = cm.getTokenAt(pos);
const tokenType = token.type;

// Only act if it's a variable
if (!tokenType || !tokenType.includes('variable')) return;

const varName = token.string;

// Get full AST and variable scopes
const ast = getAST(cm);
const varScopeMap = parseCodeVariables(cm).varScopeMap || {};
const context = getContext(cm, ast, pos, varScopeMap);

if (!context || !varScopeMap[context] || !varScopeMap[context].has(varName)) {
console.warn(`Variable "${varName}" not found in context "${context}".`);
return;
}

// Now find the actual definition location using Babel traverse
const targetIndex = cm.indexFromPos(pos);
let found = false;

traverse(ast, {
VariableDeclarator(path) {
if (found) return;

const { node } = path;
if (
node.id.type === 'Identifier' &&
node.id.name === varName &&
node.loc
) {
const defPos = cm.posFromIndex(node.start);
const defContext = getContext(cm, ast, defPos, varScopeMap);

if (defContext === context) {
found = true;
cm.setCursor(defPos);
cm.focus();
}
}
},

FunctionDeclaration(path) {
// Handle function parameters like: function foo(x) { x }
if (found) return;

const { node } = path;
if (!node.params || !node.loc) return;

for (const param of node.params) {
if (
param.type === 'Identifier' &&
param.name === varName &&
param.loc
) {
const defPos = cm.posFromIndex(param.start);
const defContext = getContext(cm, ast, defPos, varScopeMap);

if (defContext === context) {
found = true;
cm.setCursor(defPos);
cm.focus();
}
}
}
}
});

if (!found) {
console.warn(
`Definition for "${varName}" not found in context "${context}".`
);
}
}
1 change: 1 addition & 0 deletions client/modules/IDE/components/parseCodeVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function _parseCodeVariables(_cm) {
};

lastValidResult = result;
console.log('result=', result);
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions client/modules/IDE/components/rename-variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function handleRename(fromPos, oldName, newName, cm) {
const matches = getMatches(cm, state, state.query);
}

function getContext(cm, ast, fromPos, varScopeMap) {
export function getContext(cm, ast, fromPos, varScopeMap) {
const posIndex = cm.indexFromPos(fromPos);
let foundNode = null;
let enclosingFunction = null;
Expand Down Expand Up @@ -140,7 +140,7 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
});
}

function getAST(cm) {
export function getAST(cm) {
const code = cm.getValue();
const cursor = cm.getCursor();
const offset = cm.indexFromPos(cursor);
Expand Down
3 changes: 3 additions & 0 deletions client/modules/IDE/pages/IDEView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '../components/Editor/MobileEditor';
import IDEOverlays from '../components/IDEOverlays';
import useIsMobile from '../hooks/useIsMobile';
import Banner from '../components/Banner';
import { P5VersionProvider } from '../hooks/useP5Version';

function getTitle(project) {
Expand Down Expand Up @@ -105,6 +106,7 @@ const IDEView = () => {
const [sidebarSize, setSidebarSize] = useState(160);
const [isOverlayVisible, setIsOverlayVisible] = useState(false);
const [MaxSize, setMaxSize] = useState(window.innerWidth);
const [displayBanner, setDisplayBanner] = useState(false);

const cmRef = useRef({});

Expand Down Expand Up @@ -171,6 +173,7 @@ const IDEView = () => {
<Helmet>
<title>{getTitle(project)}</title>
</Helmet>
{displayBanner && <Banner onClose={() => setDisplayBanner(false)} />}
<IDEKeyHandlers getContent={() => cmRef.current?.getContent()} />
<WarnIfUnsavedChanges />
<Toast />
Expand Down
Loading