diff --git a/.eslintrc b/.eslintrc index 06ed7ddb93..6260aa925a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,8 @@ "import/named": 0, "import/namespace": 0, "import/no-unresolved": 0, - "import/no-named-as-default": 2, + "import/no-named-as-default": 0, + "import/no-named-as-default-member": 0, "comma-dangle": 0, // not sure why airbnb turned this on. gross! "indent": 0, "no-console": 0, diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index f60eef8aa6..e708b71558 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -19,16 +19,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push to Docker Hub - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 883224dc76..08e8f4ffe5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: release - name: Set up Docker Buildx @@ -27,12 +27,12 @@ jobs: with: platforms: linux/amd64,linux/arm64 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push to Docker Hub - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile diff --git a/.storybook/main.js b/.storybook/main.js index 1d892d7bbe..3596c88b9e 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -4,7 +4,8 @@ const config = { addons: [ '@storybook/addon-links', '@storybook/addon-essentials', - '@storybook/addon-interactions' + '@storybook/addon-interactions', + '@storybook/addon-mdx-gfm' ], framework: { name: '@storybook/react-webpack5', diff --git a/Dockerfile b/Dockerfile index 4e25bed7c5..ac21908220 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.14.2 as base +FROM node:16.14.2 AS base ENV APP_HOME=/usr/src/app \ TERM=xterm RUN mkdir -p $APP_HOME @@ -6,7 +6,7 @@ WORKDIR $APP_HOME EXPOSE 8000 EXPOSE 8002 -FROM base as development +FROM base AS development ENV NODE_ENV development COPY package.json package-lock.json ./ RUN npm install @@ -18,11 +18,11 @@ COPY translations/locales ./translations/locales COPY public ./public CMD ["npm", "start"] -FROM development as build +FROM development AS build ENV NODE_ENV production RUN npm run build -FROM base as production +FROM base AS production ENV NODE_ENV=production COPY package.json package-lock.json index.js ./ RUN npm install --production diff --git a/README.md b/README.md index cdd7a447d0..36d7195f88 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,9 @@ Make your first sketch in the [p5.js Editor](https://editor.p5js.org/)! Learn mo If you have found a bug in the p5.js Web Editor, you can file it under the ["issues" tab](https://github.com/processing/p5.js-web-editor/issues). You can also request new features here. A set of templates for reporting issues and requesting features are provided to assist you (and us!). The p5.js Editor is maintained mostly by volunteers, so we thank you for your patience as we try to address your issues as soon as we can. Please post bugs and feature requests in the correct repository if you can: * p5.js library: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues) -* p5.accessibility: [https://github.com/processing/p5.accessibility/issues](https://github.com/processing/p5.accessibility/issues) -* p5.sound: [https://github.com/processing/p5.js-sound/issues](https://github.com/processing/p5.js-sound/issues) * p5.js website: [https://github.com/processing/p5.js-website/issues](https://github.com/processing/p5.js-website/issues) -### How Do I Know My Issue or Pull Request is Getting Reviewed? - -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). - - ## References for Contributing to the p5.js Web Editor [Code of Conduct](https://editor.p5js.org/code-of-conduct) diff --git a/client/common/useKeyDownHandlers.js b/client/common/useKeyDownHandlers.js index ce57ab5925..dbe2ee06bb 100644 --- a/client/common/useKeyDownHandlers.js +++ b/client/common/useKeyDownHandlers.js @@ -33,7 +33,14 @@ export default function useKeyDownHandlers(keyHandlers) { const isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1; const isCtrl = isMac ? e.metaKey : e.ctrlKey; if (e.shiftKey && isCtrl) { - handlers.current[`ctrl-shift-${e.key.toLowerCase()}`]?.(e); + handlers.current[ + `ctrl-shift-${ + /^\d+$/.test(e.code.at(-1)) ? e.code.at(-1) : e.key.toLowerCase() + }` + ]?.(e); + } else if (isCtrl && e.altKey && e.code === 'KeyN') { + // specifically for creating a new file + handlers.current[`ctrl-alt-n`]?.(e); } else if (isCtrl) { handlers.current[`ctrl-${e.key.toLowerCase()}`]?.(e); } diff --git a/client/components/Dropdown/DropdownMenu.jsx b/client/components/Dropdown/DropdownMenu.jsx index da41b30101..3371d1d6cc 100644 --- a/client/components/Dropdown/DropdownMenu.jsx +++ b/client/components/Dropdown/DropdownMenu.jsx @@ -38,7 +38,7 @@ const DropdownMenu = forwardRef( }; return ( -
'); - html[0] = `${html[0]}`; - htmlFile = html.join(''); - }); - - cssFiles.forEach((file) => { - // Add css files as style tags - const html = htmlFile.split(''); - html[0] = `${html[0]}`; - htmlFile = html.join(''); - }); - - linkedFiles.forEach((file) => { - // Add linked files as link tags - const html = htmlFile.split('
'); - html[1] = `${html[1]}`; - htmlFile = html.join('
'); - }); - - // Add 404 html and position canvas - htmlFile = insertErrorMessage(htmlFile); - - // Fix links to assets - htmlFile = htmlFile.replace( - /'assets/g, - "'https://rawgit.com/processing/p5.js-website/main/dist/assets/examples/assets/" - ); - htmlFile = htmlFile.replace( - /"assets/g, - '"https://rawgit.com/processing/p5.js-website/main/dist/assets/examples/assets/' - ); - - // Change canvas size - htmlFile = htmlFile.replace( - /createCanvas\(\d+, ?\d+/g, - instanceMode - ? 'createCanvas(p.windowWidth, p.windowHeight' - : 'createCanvas(windowWidth, windowHeight' - ); - - callback(htmlFile); - }); - } else { - callback( - insertErrorMessage(` - -
- - -
-