From b16dada82ed848b2e3f89f80147702bee21d49de Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Fri, 15 Nov 2024 16:22:23 -0800 Subject: [PATCH 01/33] fix: renamed files, components, imports, exports, contexts, and methods --- .../{Nav/NavBar.jsx => Menubar/Menubar.jsx} | 54 ++++---- .../MenubarItem.jsx} | 12 +- .../MenubarMenu.jsx} | 16 +-- .../components/{Nav => Menubar}/contexts.jsx | 6 +- .../IDE/components/Header/MobileNav.jsx | 10 +- client/modules/IDE/components/Header/Nav.jsx | 124 +++++++++--------- 6 files changed, 109 insertions(+), 113 deletions(-) rename client/components/{Nav/NavBar.jsx => Menubar/Menubar.jsx} (51%) rename client/components/{Nav/NavMenuItem.jsx => Menubar/MenubarItem.jsx} (73%) rename client/components/{Nav/NavDropdownMenu.jsx => Menubar/MenubarMenu.jsx} (75%) rename client/components/{Nav => Menubar}/contexts.jsx (62%) diff --git a/client/components/Nav/NavBar.jsx b/client/components/Menubar/Menubar.jsx similarity index 51% rename from client/components/Nav/NavBar.jsx rename to client/components/Menubar/Menubar.jsx index c8ae7c6377..ebd78b97d5 100644 --- a/client/components/Nav/NavBar.jsx +++ b/client/components/Menubar/Menubar.jsx @@ -1,16 +1,16 @@ import PropTypes from 'prop-types'; import React, { useCallback, useMemo, useRef, useState } from 'react'; import useModalClose from '../../common/useModalClose'; -import { MenuOpenContext, NavBarContext } from './contexts'; +import { MenuOpenContext, MenubarContext } from './contexts'; -function NavBar({ children, className }) { - const [dropdownOpen, setDropdownOpen] = useState('none'); +function Menubar({ children, className }) { + const [menuOpen, setMenuOpen] = useState('none'); const timerRef = useRef(null); const handleClose = useCallback(() => { - setDropdownOpen('none'); - }, [setDropdownOpen]); + setMenuOpen('none'); + }, [setMenuOpen]); const nodeRef = useModalClose(handleClose); @@ -22,71 +22,67 @@ function NavBar({ children, className }) { }, [timerRef]); const handleBlur = useCallback(() => { - timerRef.current = setTimeout(() => setDropdownOpen('none'), 10); - }, [timerRef, setDropdownOpen]); + timerRef.current = setTimeout(() => setMenuOpen('none'), 10); + }, [timerRef, setMenuOpen]); - const toggleDropdownOpen = useCallback( - (dropdown) => { - setDropdownOpen((prevState) => - prevState === dropdown ? 'none' : dropdown - ); + const toggleMenuOpen = useCallback( + (menu) => { + setMenuOpen((prevState) => (prevState === menu ? 'none' : menu)); }, - [setDropdownOpen] + [setMenuOpen] ); const contextValue = useMemo( () => ({ - createDropdownHandlers: (dropdown) => ({ + createMenuHandlers: (menu) => ({ onMouseOver: () => { - setDropdownOpen((prevState) => - prevState === 'none' ? 'none' : dropdown - ); + setMenuOpen((prevState) => (prevState === 'none' ? 'none' : menu)); }, onClick: () => { - toggleDropdownOpen(dropdown); + toggleMenuOpen(menu); }, onBlur: handleBlur, onFocus: clearHideTimeout }), - createMenuItemHandlers: (dropdown) => ({ + createMenuItemHandlers: (menu) => ({ onMouseUp: (e) => { if (e.button === 2) { return; } - setDropdownOpen('none'); + setMenuOpen('none'); }, onBlur: handleBlur, onFocus: () => { clearHideTimeout(); - setDropdownOpen(dropdown); + setMenuOpen(menu); } }), - toggleDropdownOpen + toggleMenuOpen }), - [setDropdownOpen, toggleDropdownOpen, clearHideTimeout, handleBlur] + [setMenuOpen, toggleMenuOpen, clearHideTimeout, handleBlur] ); return ( - +
- + {children}
-
+ ); } -NavBar.propTypes = { +Menubar.propTypes = { children: PropTypes.node, className: PropTypes.string }; -NavBar.defaultProps = { +Menubar.defaultProps = { children: null, className: 'nav' }; -export default NavBar; +export default Menubar; diff --git a/client/components/Nav/NavMenuItem.jsx b/client/components/Menubar/MenubarItem.jsx similarity index 73% rename from client/components/Nav/NavMenuItem.jsx rename to client/components/Menubar/MenubarItem.jsx index 09436e43ee..8c08aa9c03 100644 --- a/client/components/Nav/NavMenuItem.jsx +++ b/client/components/Menubar/MenubarItem.jsx @@ -1,12 +1,12 @@ import PropTypes from 'prop-types'; import React, { useContext, useMemo } from 'react'; import ButtonOrLink from '../../common/ButtonOrLink'; -import { NavBarContext, ParentMenuContext } from './contexts'; +import { MenubarContext, ParentMenuContext } from './contexts'; -function NavMenuItem({ hideIf, className, ...rest }) { +function MenubarItem({ hideIf, className, ...rest }) { const parent = useContext(ParentMenuContext); - const { createMenuItemHandlers } = useContext(NavBarContext); + const { createMenuItemHandlers } = useContext(MenubarContext); const handlers = useMemo(() => createMenuItemHandlers(parent), [ createMenuItemHandlers, @@ -24,7 +24,7 @@ function NavMenuItem({ hideIf, className, ...rest }) { ); } -NavMenuItem.propTypes = { +MenubarItem.propTypes = { ...ButtonOrLink.propTypes, onClick: PropTypes.func, value: PropTypes.string, @@ -35,11 +35,11 @@ NavMenuItem.propTypes = { className: PropTypes.string }; -NavMenuItem.defaultProps = { +MenubarItem.defaultProps = { onClick: null, value: null, hideIf: false, className: 'nav__dropdown-item' }; -export default NavMenuItem; +export default MenubarItem; diff --git a/client/components/Nav/NavDropdownMenu.jsx b/client/components/Menubar/MenubarMenu.jsx similarity index 75% rename from client/components/Nav/NavDropdownMenu.jsx rename to client/components/Menubar/MenubarMenu.jsx index d2c5744c46..4dd47d3fb5 100644 --- a/client/components/Nav/NavDropdownMenu.jsx +++ b/client/components/Menubar/MenubarMenu.jsx @@ -2,24 +2,24 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; import React, { useContext, useMemo } from 'react'; import TriangleIcon from '../../images/down-filled-triangle.svg'; -import { MenuOpenContext, NavBarContext, ParentMenuContext } from './contexts'; +import { MenuOpenContext, MenubarContext, ParentMenuContext } from './contexts'; export function useMenuProps(id) { const activeMenu = useContext(MenuOpenContext); const isOpen = id === activeMenu; - const { createDropdownHandlers } = useContext(NavBarContext); + const { createMenuHandlers } = useContext(MenubarContext); - const handlers = useMemo(() => createDropdownHandlers(id), [ - createDropdownHandlers, + const handlers = useMemo(() => createMenuHandlers(id), [ + createMenuHandlers, id ]); return { isOpen, handlers }; } -function NavDropdownMenu({ id, title, children }) { +function MenubarMenu({ id, title, children }) { const { isOpen, handlers } = useMenuProps(id); return ( @@ -46,14 +46,14 @@ function NavDropdownMenu({ id, title, children }) { ); } -NavDropdownMenu.propTypes = { +MenubarMenu.propTypes = { id: PropTypes.string.isRequired, title: PropTypes.node.isRequired, children: PropTypes.node }; -NavDropdownMenu.defaultProps = { +MenubarMenu.defaultProps = { children: null }; -export default NavDropdownMenu; +export default MenubarMenu; diff --git a/client/components/Nav/contexts.jsx b/client/components/Menubar/contexts.jsx similarity index 62% rename from client/components/Nav/contexts.jsx rename to client/components/Menubar/contexts.jsx index 896d7283f4..ab3bb9ffcf 100644 --- a/client/components/Nav/contexts.jsx +++ b/client/components/Menubar/contexts.jsx @@ -4,8 +4,8 @@ export const ParentMenuContext = createContext('none'); export const MenuOpenContext = createContext('none'); -export const NavBarContext = createContext({ - createDropdownHandlers: () => ({}), +export const MenubarContext = createContext({ + createMenuHandlers: () => ({}), createMenuItemHandlers: () => ({}), - toggleDropdownOpen: () => {} + toggleMenuOpen: () => {} }); diff --git a/client/modules/IDE/components/Header/MobileNav.jsx b/client/modules/IDE/components/Header/MobileNav.jsx index 37fa16bed3..c1fd718a8f 100644 --- a/client/modules/IDE/components/Header/MobileNav.jsx +++ b/client/modules/IDE/components/Header/MobileNav.jsx @@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { sortBy } from 'lodash'; import classNames from 'classnames'; -import { ParentMenuContext } from '../../../../components/Nav/contexts'; -import NavBar from '../../../../components/Nav/NavBar'; -import { useMenuProps } from '../../../../components/Nav/NavDropdownMenu'; -import NavMenuItem from '../../../../components/Nav/NavMenuItem'; +import { ParentMenuContext } from '../../../../components/Menubar/contexts'; +import Menubar from '../../../../components/Menubar/Menubar'; +import { useMenuProps } from '../../../../components/Menubar/MenubarMenu'; +import NavMenuItem from '../../../../components/Menubar/MenubarItem'; import { prop, remSize } from '../../../../theme'; import AsteriskIcon from '../../../../images/p5-asterisk.svg'; import IconButton from '../../../../common/IconButton'; @@ -36,7 +36,7 @@ import Overlay from '../../../App/components/Overlay'; import ProjectName from './ProjectName'; import CollectionCreate from '../../../User/components/CollectionCreate'; -const Nav = styled(NavBar)` +const Nav = styled(Menubar)` background: ${prop('MobilePanel.default.background')}; color: ${prop('primaryTextColor')}; padding: ${remSize(8)} 0; diff --git a/client/modules/IDE/components/Header/Nav.jsx b/client/modules/IDE/components/Header/Nav.jsx index 3492c4388a..dc6b0c6b71 100644 --- a/client/modules/IDE/components/Header/Nav.jsx +++ b/client/modules/IDE/components/Header/Nav.jsx @@ -4,13 +4,13 @@ import { sortBy } from 'lodash'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; -import NavDropdownMenu from '../../../../components/Nav/NavDropdownMenu'; -import NavMenuItem from '../../../../components/Nav/NavMenuItem'; +import MenubarMenu from '../../../../components/Menubar/MenubarMenu'; +import MenubarItem from '../../../../components/Menubar/MenubarItem'; import { availableLanguages, languageKeyToLabel } from '../../../../i18n'; import getConfig from '../../../../utils/getConfig'; import { showToast } from '../../actions/toast'; import { setLanguage } from '../../actions/preferences'; -import NavBar from '../../../../components/Nav/NavBar'; +import Menubar from '../../../../components/Menubar/Menubar'; import CaretLeftIcon from '../../../../images/left-arrow.svg'; import LogoIcon from '../../../../images/p5js-logo-small.svg'; import { selectRootFile } from '../../selectors/files'; @@ -37,10 +37,10 @@ const Nav = ({ layout }) => { return isMobile ? ( ) : ( - + - + ); }; @@ -159,9 +159,9 @@ const ProjectMenu = () => { )} - - {t('Nav.File.New')} - + {t('Nav.File.New')} + { > {t('Common.Save')} {metaKeyName}+S - - + dispatch(cloneProject())} > {t('Nav.File.Duplicate')} - - + + {t('Nav.File.Share')} - - + + {t('Nav.File.Download')} - - + {t('Nav.File.Open')} - - + { href={`/${user.username}/sketches/${project?.id}/add-to-collection`} > {t('Nav.File.AddToCollection')} - - + {t('Nav.File.Examples')} - - - - + + + + {t('Nav.Edit.TidyCode')} {metaKeyName}+Shift+F - - + + {t('Nav.Edit.Find')} {metaKeyName}+F - - + + {t('Nav.Edit.Replace')} {replaceCommand} - - - - dispatch(newFile(rootFile.id))}> + + + + dispatch(newFile(rootFile.id))}> {t('Nav.Sketch.AddFile')} {newFileCommand} - - dispatch(newFolder(rootFile.id))}> + + dispatch(newFolder(rootFile.id))}> {t('Nav.Sketch.AddFolder')} - - dispatch(startSketch())}> + + dispatch(startSketch())}> {t('Nav.Sketch.Run')} {metaKeyName}+Enter - - dispatch(stopSketch())}> + + dispatch(stopSketch())}> {t('Nav.Sketch.Stop')} Shift+{metaKeyName}+Enter - - - - dispatch(showKeyboardShortcutModal())}> + + + + dispatch(showKeyboardShortcutModal())}> {t('Nav.Help.KeyboardShortcuts')} - - + + {t('Nav.Help.Reference')} - - {t('Nav.Help.About')} - + + {t('Nav.Help.About')} + ); }; @@ -261,14 +261,14 @@ const LanguageMenu = () => { } return ( - + {sortBy(availableLanguages).map((key) => ( // eslint-disable-next-line react/jsx-no-bind - + {languageKeyToLabel(key)} - + ))} - + ); }; @@ -305,7 +305,7 @@ const AuthenticatedUserMenu = () => { return ( ); }; From 0f9cf65c9c050ebed8c86bd9070f41ac1b29a3f0 Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Mon, 18 Nov 2024 14:05:14 -0800 Subject: [PATCH 02/33] refactor: separated UserMenu from the menubar component, wrapped both in a header container, removed navigation role from UserMenu --- client/components/Menubar/Menubar.jsx | 12 +++++------- client/modules/IDE/components/Header/Nav.jsx | 16 ++++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/client/components/Menubar/Menubar.jsx b/client/components/Menubar/Menubar.jsx index ebd78b97d5..b806246515 100644 --- a/client/components/Menubar/Menubar.jsx +++ b/client/components/Menubar/Menubar.jsx @@ -64,13 +64,11 @@ function Menubar({ children, className }) { return ( -
-
- - {children} - -
-
+
+ + {children} + +
); } diff --git a/client/modules/IDE/components/Header/Nav.jsx b/client/modules/IDE/components/Header/Nav.jsx index dc6b0c6b71..0e5f2cdac7 100644 --- a/client/modules/IDE/components/Header/Nav.jsx +++ b/client/modules/IDE/components/Header/Nav.jsx @@ -37,10 +37,14 @@ const Nav = ({ layout }) => { return isMobile ? ( ) : ( - - - - + <> +
+ + + + +
+ ); }; @@ -275,7 +279,7 @@ const LanguageMenu = () => { const UnauthenticatedUserMenu = () => { const { t } = useTranslation(); return ( -
    +
      {getConfig('TRANSLATIONS_ENABLED') && }
    • @@ -303,7 +307,7 @@ const AuthenticatedUserMenu = () => { const dispatch = useDispatch(); return ( -
        +
          {getConfig('TRANSLATIONS_ENABLED') && } Date: Mon, 18 Nov 2024 14:07:06 -0800 Subject: [PATCH 03/33] style: updated header and menubar styles --- client/styles/components/_nav.scss | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/client/styles/components/_nav.scss b/client/styles/components/_nav.scss index 1f4a7fc364..4ddc96b327 100644 --- a/client/styles/components/_nav.scss +++ b/client/styles/components/_nav.scss @@ -6,23 +6,31 @@ flex-direction: row; justify-content: space-between; - @include themify() { - border-bottom: 1px dashed map-get($theme-map, 'nav-border-color'); - } - & button { padding: 0; } } +.nav__header { + display: flex; + flex-direction: row; + justify-content: space-between; + height: 100%; + align-items: center; + + @include themify() { + border-bottom: 1px dashed map-get($theme-map, 'nav-border-color'); + } + // padding-left: #{math.div(20, $base-font-size)}rem; +} + .nav__items-left, .nav__items-right { list-style: none; display: flex; flex-direction: row; - justify-content: flex-end; - height: 100%; align-items: center; + height: 100%; } .preview-nav__editor-svg { From 246597f9442dfc70d83a80125d740fb05c6a503e Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Mon, 18 Nov 2024 15:52:26 -0800 Subject: [PATCH 04/33] refactor: moved LanguageMenu into left items --- client/modules/IDE/components/Header/Nav.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/modules/IDE/components/Header/Nav.jsx b/client/modules/IDE/components/Header/Nav.jsx index 0e5f2cdac7..6721209761 100644 --- a/client/modules/IDE/components/Header/Nav.jsx +++ b/client/modules/IDE/components/Header/Nav.jsx @@ -251,6 +251,7 @@ const ProjectMenu = () => { {t('Nav.Help.About')} + {getConfig('TRANSLATIONS_ENABLED') && }
        ); }; @@ -280,7 +281,6 @@ const UnauthenticatedUserMenu = () => { const { t } = useTranslation(); return (
          - {getConfig('TRANSLATIONS_ENABLED') && }
        • @@ -308,7 +308,6 @@ const AuthenticatedUserMenu = () => { return (
            - {getConfig('TRANSLATIONS_ENABLED') && } Date: Mon, 18 Nov 2024 16:06:30 -0800 Subject: [PATCH 05/33] refactor: split new MenubarMenu component into Trigger, List, and Menu components --- client/components/Menubar/MenubarMenu.jsx | 65 ++++++++++++++++------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/client/components/Menubar/MenubarMenu.jsx b/client/components/Menubar/MenubarMenu.jsx index 4dd47d3fb5..5453e6c8d8 100644 --- a/client/components/Menubar/MenubarMenu.jsx +++ b/client/components/Menubar/MenubarMenu.jsx @@ -19,29 +19,58 @@ export function useMenuProps(id) { return { isOpen, handlers }; } +function MenubarTrigger({ id, title, ...props }) { + const { isOpen, handlers } = useMenuProps(id); + + return ( + + ); +} + +MenubarTrigger.propTypes = { + id: PropTypes.string.isRequired, + title: PropTypes.node.isRequired +}; + +function MenubarList({ id, children }) { + return ( +
              + + {children} + +
            + ); +} + +MenubarList.propTypes = { + id: PropTypes.string.isRequired, + children: PropTypes.node +}; + +MenubarList.defaultProps = { + children: null +}; + function MenubarMenu({ id, title, children }) { const { isOpen, handlers } = useMenuProps(id); return (
          • - -
              - - {children} - -
            + + {children}
          • ); } From 7c3b896800f5828cf99eaa02565b760736887417 Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Mon, 18 Nov 2024 16:08:52 -0800 Subject: [PATCH 06/33] test: updated snapshots --- .../__snapshots__/Nav.unit.test.jsx.snap | 732 +++++++++--------- 1 file changed, 366 insertions(+), 366 deletions(-) diff --git a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap index af56a1a418..d9140653c1 100644 --- a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap +++ b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap @@ -2,7 +2,9 @@ exports[`Nav renders dashboard version for desktop 1`] = ` -
            +
          - + `; exports[`Nav renders editor version for desktop 1`] = ` -
          +
        • +
        - + `; From b2eb033a463be90db1aba6daaa503d3e32094dfc Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Tue, 19 Nov 2024 10:06:35 -0800 Subject: [PATCH 07/33] refactor: removed menuitem roles from sign up and login, added role=presentation to or --- client/modules/IDE/components/Header/Nav.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/modules/IDE/components/Header/Nav.jsx b/client/modules/IDE/components/Header/Nav.jsx index 6721209761..6ddc38bda2 100644 --- a/client/modules/IDE/components/Header/Nav.jsx +++ b/client/modules/IDE/components/Header/Nav.jsx @@ -282,15 +282,17 @@ const UnauthenticatedUserMenu = () => { return (
        • - + {t('Nav.Login')}
        • -
        • {t('Nav.LoginOr')}
        • +
        • + {t('Nav.LoginOr')} +
        • - + {t('Nav.SignUp')} From 06e915277cbb3471cb9c2523c2853c43a0b6637c Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Tue, 19 Nov 2024 10:08:02 -0800 Subject: [PATCH 08/33] fix: lint fixes --- client/components/Menubar/MenubarMenu.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/Menubar/MenubarMenu.jsx b/client/components/Menubar/MenubarMenu.jsx index 5453e6c8d8..67c7eb91e3 100644 --- a/client/components/Menubar/MenubarMenu.jsx +++ b/client/components/Menubar/MenubarMenu.jsx @@ -65,7 +65,7 @@ MenubarList.defaultProps = { }; function MenubarMenu({ id, title, children }) { - const { isOpen, handlers } = useMenuProps(id); + const { isOpen } = useMenuProps(id); return (
        • From 905ac20605f183b91779c638e59a59fc757219c8 Mon Sep 17 00:00:00 2001 From: Tristan Espinoza Date: Tue, 19 Nov 2024 10:18:19 -0800 Subject: [PATCH 09/33] chore: added separators between components within MenubarMenu --- client/components/Menubar/MenubarMenu.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/components/Menubar/MenubarMenu.jsx b/client/components/Menubar/MenubarMenu.jsx index 67c7eb91e3..34192b237b 100644 --- a/client/components/Menubar/MenubarMenu.jsx +++ b/client/components/Menubar/MenubarMenu.jsx @@ -19,6 +19,10 @@ export function useMenuProps(id) { return { isOpen, handlers }; } +/* ------------------------------------------------------------------------------------------------- + * MenubarTrigger + * -----------------------------------------------------------------------------------------------*/ + function MenubarTrigger({ id, title, ...props }) { const { isOpen, handlers } = useMenuProps(id); @@ -45,6 +49,10 @@ MenubarTrigger.propTypes = { title: PropTypes.node.isRequired }; +/* ------------------------------------------------------------------------------------------------- + * MenubarList + * -----------------------------------------------------------------------------------------------*/ + function MenubarList({ id, children }) { return (
            @@ -64,6 +72,10 @@ MenubarList.defaultProps = { children: null }; +/* ------------------------------------------------------------------------------------------------- + * MenubarMenu + * -----------------------------------------------------------------------------------------------*/ + function MenubarMenu({ id, title, children }) { const { isOpen } = useMenuProps(id); From b8a45d5ba22f14f961e0ae7938606e6e8140fdf9 Mon Sep 17 00:00:00 2001 From: Pratyush Raj Date: Sat, 2 Nov 2024 19:42:32 +0530 Subject: [PATCH 10/33] Fix#3241 Icon Alligment issue in Password Field --- client/styles/components/_forms.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/styles/components/_forms.scss b/client/styles/components/_forms.scss index d1237935cc..cf2d8df31f 100644 --- a/client/styles/components/_forms.scss +++ b/client/styles/components/_forms.scss @@ -75,13 +75,15 @@ .form__field__password { position: relative; + display: flex; + align-items: center; } .form__eye__icon { font-size: 28px; position: absolute; right: 0px; - top: 4px; + display: flex; vertical-align: middle; } From dbc98dd28c6fb0916434102dd360c4b858457dfc Mon Sep 17 00:00:00 2001 From: pratyushsawan Date: Sat, 23 Nov 2024 21:42:57 +0530 Subject: [PATCH 11/33] added some fixes on the eye-svg --- client/styles/components/_forms.scss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/styles/components/_forms.scss b/client/styles/components/_forms.scss index cf2d8df31f..daf5fa0d08 100644 --- a/client/styles/components/_forms.scss +++ b/client/styles/components/_forms.scss @@ -80,11 +80,13 @@ } .form__eye__icon { - font-size: 28px; + font-size: #{math.div(30, $base-font-size)}rem; position: absolute; right: 0px; - display: flex; - vertical-align: middle; + + & svg { + transform: translateY(10%); + } } From 72daf4d1ded685bf38613efa8836e8a9b7231b6b Mon Sep 17 00:00:00 2001 From: raclim Date: Tue, 26 Nov 2024 12:25:51 -0500 Subject: [PATCH 12/33] missing dispatch import --- client/modules/IDE/components/ConsoleInput.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/ConsoleInput.jsx b/client/modules/IDE/components/ConsoleInput.jsx index c026d29d4b..daac76839c 100644 --- a/client/modules/IDE/components/ConsoleInput.jsx +++ b/client/modules/IDE/components/ConsoleInput.jsx @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React, { useRef, useEffect, useState } from 'react'; +import { useDispatch } from 'react-redux'; import CodeMirror from 'codemirror'; import { Encode } from 'console-feed'; @@ -15,6 +16,7 @@ function ConsoleInput({ theme, fontSize }) { const [commandCursor, setCommandCursor] = useState(-1); const codemirrorContainer = useRef(null); const cmInstance = useRef(null); + const dispatch = useDispatch(); useEffect(() => { cmInstance.current = CodeMirror(codemirrorContainer.current, { @@ -45,7 +47,7 @@ function ConsoleInput({ theme, fontSize }) { payload: { source: 'console', messages } }); - dispatchConsoleEvent(consoleEvent); + dispatch(dispatchConsoleEvent(consoleEvent)); cm.setValue(''); setCommandHistory([value, ...commandHistory]); setCommandCursor(-1); From e5e2ec12dbea69bc79d93c3b152adbe54169d141 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 27 Nov 2024 17:04:40 -0500 Subject: [PATCH 13/33] wrap actions with dispatch --- client/modules/IDE/components/FileNode.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index e589fb3cff..04d7223bdb 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import React, { useState, useRef } from 'react'; -import { connect } from 'react-redux'; +import { connect, useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; import * as IDEActions from '../actions/ide'; @@ -87,6 +87,7 @@ const FileNode = ({ const [isEditingName, setIsEditingName] = useState(false); const [isDeleting, setIsDeleting] = useState(false); const [updatedName, setUpdatedName] = useState(name); + const dispatch = useDispatch(); const { t } = useTranslation(); const fileNameInput = useRef(null); @@ -122,17 +123,17 @@ const FileNode = ({ }; const handleClickAddFile = () => { - newFile(id); + dispatch(newFile(id)); setTimeout(() => hideFileOptions(), 0); }; const handleClickAddFolder = () => { - newFolder(id); + dispatch(newFolder(id)); setTimeout(() => hideFileOptions(), 0); }; const handleClickUploadFile = () => { - openUploadFileModal(id); + dispatch(openUploadFileModal(id)); setTimeout(hideFileOptions, 0); }; From f122ec62d0b5a337d46578c2596f0a84a951c5e0 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 27 Nov 2024 18:46:21 -0500 Subject: [PATCH 14/33] update test to add useDispatch --- .../IDE/components/FileNode.unit.test.jsx | 64 ++++++++++++++----- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/client/modules/IDE/components/FileNode.unit.test.jsx b/client/modules/IDE/components/FileNode.unit.test.jsx index 8676a817d8..86d3504626 100644 --- a/client/modules/IDE/components/FileNode.unit.test.jsx +++ b/client/modules/IDE/components/FileNode.unit.test.jsx @@ -1,4 +1,7 @@ import React from 'react'; +import { Provider } from 'react-redux'; +import configureStore from 'redux-mock-store'; +import { useDispatch } from 'react-redux'; import { fireEvent, @@ -9,7 +12,19 @@ import { } from '../../../test-utils'; import { FileNode } from './FileNode'; +jest.mock('react-redux', () => ({ + ...jest.requireActual('react-redux'), + useDispatch: jest.fn() +})); + describe('', () => { + const mockDispatch = jest.fn(); + const mockStore = configureStore([]); + + beforeEach(() => { + useDispatch.mockReturnValue(mockDispatch); + }); + const changeName = (newFileName) => { const renameButton = screen.getByText(/Rename/i); fireEvent.click(renameButton); @@ -25,6 +40,19 @@ describe('', () => { }; const renderFileNode = (fileType, extraProps = {}) => { + const initialState = { + files: [ + { + id: '0', + name: fileType === 'folder' ? 'afolder' : 'test.jsx', + fileType + } + ], + user: { authenticated: false } + }; + + const store = mockStore(initialState); + const props = { ...extraProps, id: '0', @@ -45,24 +73,28 @@ describe('', () => { setProjectName: jest.fn() }; - render(); + render( + + + + ); - return props; + return { store, props }; }; describe('fileType: file', () => { it('cannot change to an empty name', async () => { - const props = renderFileNode('file'); + const { props } = renderFileNode('file'); changeName(''); - await waitFor(() => expect(props.updateFileName).not.toHaveBeenCalled()); + await waitFor(() => expect(mockDispatch).not.toHaveBeenCalled()); await expectFileNameToBe(props.name); }); it('can change to a valid filename', async () => { const newName = 'newname.jsx'; - const props = renderFileNode('file'); + const { props } = renderFileNode('file'); changeName(newName); @@ -74,11 +106,11 @@ describe('', () => { it('must have an extension', async () => { const newName = 'newname'; - const props = renderFileNode('file'); + const { props } = renderFileNode('file'); changeName(newName); - await waitFor(() => expect(props.updateFileName).not.toHaveBeenCalled()); + await waitFor(() => expect(mockDispatch).not.toHaveBeenCalled()); await expectFileNameToBe(props.name); }); @@ -87,7 +119,7 @@ describe('', () => { window.confirm = mockConfirm; const newName = 'newname.gif'; - const props = renderFileNode('file'); + const { props } = renderFileNode('file'); changeName(newName); @@ -95,33 +127,33 @@ describe('', () => { await waitFor(() => expect(props.updateFileName).toHaveBeenCalledWith(props.id, newName) ); - await expectFileNameToBe(props.name); + await expectFileNameToBe(newName); }); it('cannot be just an extension', async () => { const newName = '.jsx'; - const props = renderFileNode('file'); + const { props } = renderFileNode('file'); changeName(newName); - await waitFor(() => expect(props.updateFileName).not.toHaveBeenCalled()); + await waitFor(() => expect(mockDispatch).not.toHaveBeenCalled()); await expectFileNameToBe(props.name); }); }); describe('fileType: folder', () => { it('cannot change to an empty name', async () => { - const props = renderFileNode('folder'); + const { props } = renderFileNode('folder'); changeName(''); - await waitFor(() => expect(props.updateFileName).not.toHaveBeenCalled()); + await waitFor(() => expect(mockDispatch).not.toHaveBeenCalled()); await expectFileNameToBe(props.name); }); it('can change to another name', async () => { const newName = 'foldername'; - const props = renderFileNode('folder'); + const { props } = renderFileNode('folder'); changeName(newName); @@ -133,11 +165,11 @@ describe('', () => { it('cannot have a file extension', async () => { const newName = 'foldername.jsx'; - const props = renderFileNode('folder'); + const { props } = renderFileNode('folder'); changeName(newName); - await waitFor(() => expect(props.updateFileName).not.toHaveBeenCalled()); + await waitFor(() => expect(mockDispatch).not.toHaveBeenCalled()); await expectFileNameToBe(props.name); }); }); From 5c8a91249baf29b96ff20833b277107e21e79db4 Mon Sep 17 00:00:00 2001 From: raclim Date: Thu, 28 Nov 2024 10:06:18 -0500 Subject: [PATCH 15/33] update dispatch and add selectors --- client/modules/IDE/components/FileNode.jsx | 132 +++++---------------- 1 file changed, 31 insertions(+), 101 deletions(-) diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index 04d7223bdb..cd6caa3255 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -1,43 +1,17 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import React, { useState, useRef } from 'react'; -import { connect, useDispatch } from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import * as IDEActions from '../actions/ide'; import * as FileActions from '../actions/files'; +import parseFileName from '../utils/parseFileName'; import DownArrowIcon from '../../../images/down-filled-triangle.svg'; import FolderRightIcon from '../../../images/triangle-arrow-right.svg'; import FolderDownIcon from '../../../images/triangle-arrow-down.svg'; import FileTypeIcon from './FileTypeIcon'; -function parseFileName(name) { - const nameArray = name.split('.'); - if (nameArray.length > 1) { - const extension = `.${nameArray[nameArray.length - 1]}`; - const baseName = nameArray.slice(0, -1).join('.'); - const firstLetter = baseName[0]; - const lastLetter = baseName[baseName.length - 1]; - const middleText = baseName.slice(1, -1); - return { - baseName, - firstLetter, - lastLetter, - middleText, - extension - }; - } - const firstLetter = name[0]; - const lastLetter = name[name.length - 1]; - const middleText = name.slice(1, -1); - return { - baseName: name, - firstLetter, - lastLetter, - middleText - }; -} - function FileName({ name }) { const { baseName, @@ -62,41 +36,35 @@ FileName.propTypes = { name: PropTypes.string.isRequired }; -const FileNode = ({ - id, - parentId, - children, - name, - fileType, - isSelectedFile, - isFolderClosed, - setSelectedFile, - deleteFile, - updateFileName, - resetSelectedFile, - newFile, - newFolder, - showFolderChildren, - hideFolderChildren, - canEdit, - openUploadFileModal, - authenticated, - onClickFile -}) => { +const FileNode = ({ id, canEdit, onClickFile }) => { + const dispatch = useDispatch(); + const { t } = useTranslation(); + + const fileNode = + useSelector((state) => state.files.find((file) => file.id === id)) || {}; + const authenticated = useSelector((state) => state.user.authenticated); + + const { + name = '', + parentId = null, + children = [], + fileType = 'file', + isSelectedFile = false, + isFolderClosed = false + } = fileNode; + const [isOptionsOpen, setIsOptionsOpen] = useState(false); const [isEditingName, setIsEditingName] = useState(false); const [isDeleting, setIsDeleting] = useState(false); const [updatedName, setUpdatedName] = useState(name); - const dispatch = useDispatch(); - const { t } = useTranslation(); const fileNameInput = useRef(null); const fileOptionsRef = useRef(null); const handleFileClick = (event) => { event.stopPropagation(); if (name !== 'root' && !isDeleting) { - setSelectedFile(id); + dispatch(IDEActions.setSelectedFile(id)); } if (onClickFile) { onClickFile(); @@ -123,17 +91,17 @@ const FileNode = ({ }; const handleClickAddFile = () => { - dispatch(newFile(id)); + dispatch(IDEActions.newFile(id)); setTimeout(() => hideFileOptions(), 0); }; const handleClickAddFolder = () => { - dispatch(newFolder(id)); + dispatch(IDEActions.newFolder(id)); setTimeout(() => hideFileOptions(), 0); }; const handleClickUploadFile = () => { - dispatch(openUploadFileModal(id)); + dispatch(IDEActions.openUploadFileModal(id)); setTimeout(hideFileOptions, 0); }; @@ -142,8 +110,8 @@ const FileNode = ({ if (window.confirm(prompt)) { setIsDeleting(true); - resetSelectedFile(id); - setTimeout(() => deleteFile(id, parentId), 100); + dispatch(IDEActions.resetSelectedFile(id)); + setTimeout(() => dispatch(FileActions.deleteFile(id, parentId), 100)); } }; @@ -159,7 +127,7 @@ const FileNode = ({ const saveUpdatedFileName = () => { if (updatedName !== name) { - updateFileName(id, updatedName); + dispatch(FileActions.updateFileName(id, updatedName)); } }; @@ -244,7 +212,7 @@ const FileNode = ({
            - + ); From 48f9ad8ab90e9abbcc2bc35b563a0289a7b8b39e Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Sat, 30 Nov 2024 20:01:07 +0100 Subject: [PATCH 19/33] added donation banner --- client/index.jsx | 14 ++++++++++++++ client/styles/base/_base.scss | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/client/index.jsx b/client/index.jsx index 6c12fa511b..313334dc20 100644 --- a/client/index.jsx +++ b/client/index.jsx @@ -20,6 +20,20 @@ const initialState = window.__INITIAL_STATE__; const store = configureStore(initialState); +// Add a banner to the page +const banner = document.createElement('div'); +banner.id = 'processing-banner'; +document.body.appendChild(banner); + +const link = document.createElement('link'); +link.rel = 'stylesheet'; +link.href = 'https://foundation-donate-banner.netlify.app/static/css/main.css'; +document.head.appendChild(link); + +const script = document.createElement('script'); +script.src = 'https://foundation-donate-banner.netlify.app/static/js/main.js'; +document.body.appendChild(script); + const App = () => ( <> diff --git a/client/styles/base/_base.scss b/client/styles/base/_base.scss index 3e283d7ab9..ad17249932 100644 --- a/client/styles/base/_base.scss +++ b/client/styles/base/_base.scss @@ -151,3 +151,10 @@ textarea:focus { white-space: nowrap; width: 1px; } + + +// Donate banner custom properties +body { + --donate-banner-dark: #c01c4c; + --donate-banner-background: url('https://foundation-donate-banner.netlify.app/p5.png'); +} \ No newline at end of file From f84ebd9e05a01e1b4283783e7a6bfb37916f6a2c Mon Sep 17 00:00:00 2001 From: raclim Date: Mon, 2 Dec 2024 20:45:14 -0500 Subject: [PATCH 20/33] 2.15.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index de6eb98b9d..0d1b8cecf9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "p5.js-web-editor", - "version": "2.15.3", + "version": "2.15.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "p5.js-web-editor", - "version": "2.15.3", + "version": "2.15.4", "license": "LGPL-2.1", "dependencies": { "@auth0/s3": "^1.0.0", diff --git a/package.json b/package.json index 40c364e6a8..03c93a5be7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p5.js-web-editor", - "version": "2.15.3", + "version": "2.15.4", "description": "The web editor for p5.js.", "scripts": { "clean": "rimraf dist", From a361329db1856eea016c82c3ce1a627e696849e4 Mon Sep 17 00:00:00 2001 From: raclim <43053081+raclim@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:42:08 -0500 Subject: [PATCH 21/33] Revert "Fix Console Errors and Update Hooks in FileNode" --- .../modules/IDE/components/ConsoleInput.jsx | 4 +- client/modules/IDE/components/FileNode.jsx | 131 +++++++++++++----- .../IDE/components/FileNode.unit.test.jsx | 112 ++++++--------- client/modules/IDE/components/Sidebar.jsx | 4 +- client/modules/IDE/utils/parseFileName.js | 28 ---- 5 files changed, 147 insertions(+), 132 deletions(-) delete mode 100644 client/modules/IDE/utils/parseFileName.js diff --git a/client/modules/IDE/components/ConsoleInput.jsx b/client/modules/IDE/components/ConsoleInput.jsx index daac76839c..c026d29d4b 100644 --- a/client/modules/IDE/components/ConsoleInput.jsx +++ b/client/modules/IDE/components/ConsoleInput.jsx @@ -1,6 +1,5 @@ import PropTypes from 'prop-types'; import React, { useRef, useEffect, useState } from 'react'; -import { useDispatch } from 'react-redux'; import CodeMirror from 'codemirror'; import { Encode } from 'console-feed'; @@ -16,7 +15,6 @@ function ConsoleInput({ theme, fontSize }) { const [commandCursor, setCommandCursor] = useState(-1); const codemirrorContainer = useRef(null); const cmInstance = useRef(null); - const dispatch = useDispatch(); useEffect(() => { cmInstance.current = CodeMirror(codemirrorContainer.current, { @@ -47,7 +45,7 @@ function ConsoleInput({ theme, fontSize }) { payload: { source: 'console', messages } }); - dispatch(dispatchConsoleEvent(consoleEvent)); + dispatchConsoleEvent(consoleEvent); cm.setValue(''); setCommandHistory([value, ...commandHistory]); setCommandCursor(-1); diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index cd6caa3255..e589fb3cff 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -1,17 +1,43 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import React, { useState, useRef } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; +import { connect } from 'react-redux'; import { useTranslation } from 'react-i18next'; import * as IDEActions from '../actions/ide'; import * as FileActions from '../actions/files'; -import parseFileName from '../utils/parseFileName'; import DownArrowIcon from '../../../images/down-filled-triangle.svg'; import FolderRightIcon from '../../../images/triangle-arrow-right.svg'; import FolderDownIcon from '../../../images/triangle-arrow-down.svg'; import FileTypeIcon from './FileTypeIcon'; +function parseFileName(name) { + const nameArray = name.split('.'); + if (nameArray.length > 1) { + const extension = `.${nameArray[nameArray.length - 1]}`; + const baseName = nameArray.slice(0, -1).join('.'); + const firstLetter = baseName[0]; + const lastLetter = baseName[baseName.length - 1]; + const middleText = baseName.slice(1, -1); + return { + baseName, + firstLetter, + lastLetter, + middleText, + extension + }; + } + const firstLetter = name[0]; + const lastLetter = name[name.length - 1]; + const middleText = name.slice(1, -1); + return { + baseName: name, + firstLetter, + lastLetter, + middleText + }; +} + function FileName({ name }) { const { baseName, @@ -36,35 +62,40 @@ FileName.propTypes = { name: PropTypes.string.isRequired }; -const FileNode = ({ id, canEdit, onClickFile }) => { - const dispatch = useDispatch(); - const { t } = useTranslation(); - - const fileNode = - useSelector((state) => state.files.find((file) => file.id === id)) || {}; - const authenticated = useSelector((state) => state.user.authenticated); - - const { - name = '', - parentId = null, - children = [], - fileType = 'file', - isSelectedFile = false, - isFolderClosed = false - } = fileNode; - +const FileNode = ({ + id, + parentId, + children, + name, + fileType, + isSelectedFile, + isFolderClosed, + setSelectedFile, + deleteFile, + updateFileName, + resetSelectedFile, + newFile, + newFolder, + showFolderChildren, + hideFolderChildren, + canEdit, + openUploadFileModal, + authenticated, + onClickFile +}) => { const [isOptionsOpen, setIsOptionsOpen] = useState(false); const [isEditingName, setIsEditingName] = useState(false); const [isDeleting, setIsDeleting] = useState(false); const [updatedName, setUpdatedName] = useState(name); + const { t } = useTranslation(); const fileNameInput = useRef(null); const fileOptionsRef = useRef(null); const handleFileClick = (event) => { event.stopPropagation(); if (name !== 'root' && !isDeleting) { - dispatch(IDEActions.setSelectedFile(id)); + setSelectedFile(id); } if (onClickFile) { onClickFile(); @@ -91,17 +122,17 @@ const FileNode = ({ id, canEdit, onClickFile }) => { }; const handleClickAddFile = () => { - dispatch(IDEActions.newFile(id)); + newFile(id); setTimeout(() => hideFileOptions(), 0); }; const handleClickAddFolder = () => { - dispatch(IDEActions.newFolder(id)); + newFolder(id); setTimeout(() => hideFileOptions(), 0); }; const handleClickUploadFile = () => { - dispatch(IDEActions.openUploadFileModal(id)); + openUploadFileModal(id); setTimeout(hideFileOptions, 0); }; @@ -110,8 +141,8 @@ const FileNode = ({ id, canEdit, onClickFile }) => { if (window.confirm(prompt)) { setIsDeleting(true); - dispatch(IDEActions.resetSelectedFile(id)); - setTimeout(() => dispatch(FileActions.deleteFile(id, parentId), 100)); + resetSelectedFile(id); + setTimeout(() => deleteFile(id, parentId), 100); } }; @@ -127,7 +158,7 @@ const FileNode = ({ id, canEdit, onClickFile }) => { const saveUpdatedFileName = () => { if (updatedName !== name) { - dispatch(FileActions.updateFileName(id, updatedName)); + updateFileName(id, updatedName); } }; @@ -212,7 +243,7 @@ const FileNode = ({ id, canEdit, onClickFile }) => {
            - + ); diff --git a/client/modules/IDE/utils/parseFileName.js b/client/modules/IDE/utils/parseFileName.js deleted file mode 100644 index 1bde7be0f6..0000000000 --- a/client/modules/IDE/utils/parseFileName.js +++ /dev/null @@ -1,28 +0,0 @@ -function parseFileName(name) { - const nameArray = name.split('.'); - if (nameArray.length > 1) { - const extension = `.${nameArray[nameArray.length - 1]}`; - const baseName = nameArray.slice(0, -1).join('.'); - const firstLetter = baseName[0]; - const lastLetter = baseName[baseName.length - 1]; - const middleText = baseName.slice(1, -1); - return { - baseName, - firstLetter, - lastLetter, - middleText, - extension - }; - } - const firstLetter = name[0]; - const lastLetter = name[name.length - 1]; - const middleText = name.slice(1, -1); - return { - baseName: name, - firstLetter, - lastLetter, - middleText - }; -} - -export default parseFileName; From b63c031c6f42498b2512a1a12a06eacb88eff5a9 Mon Sep 17 00:00:00 2001 From: raclim Date: Tue, 3 Dec 2024 00:51:56 -0500 Subject: [PATCH 22/33] add back in consoleinput changes --- client/modules/IDE/components/ConsoleInput.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/ConsoleInput.jsx b/client/modules/IDE/components/ConsoleInput.jsx index c026d29d4b..62e7da13a9 100644 --- a/client/modules/IDE/components/ConsoleInput.jsx +++ b/client/modules/IDE/components/ConsoleInput.jsx @@ -1,6 +1,7 @@ import PropTypes from 'prop-types'; import React, { useRef, useEffect, useState } from 'react'; import CodeMirror from 'codemirror'; +import { useDispatch } from 'react-redux'; import { Encode } from 'console-feed'; import RightArrowIcon from '../../../images/right-arrow.svg'; @@ -15,6 +16,7 @@ function ConsoleInput({ theme, fontSize }) { const [commandCursor, setCommandCursor] = useState(-1); const codemirrorContainer = useRef(null); const cmInstance = useRef(null); + const dispatch = useDispatch(); useEffect(() => { cmInstance.current = CodeMirror(codemirrorContainer.current, { @@ -45,7 +47,7 @@ function ConsoleInput({ theme, fontSize }) { payload: { source: 'console', messages } }); - dispatchConsoleEvent(consoleEvent); + dispatch(dispatchConsoleEvent(consoleEvent)); cm.setValue(''); setCommandHistory([value, ...commandHistory]); setCommandCursor(-1); From c8118f639550c738d8df72542539259d939b2118 Mon Sep 17 00:00:00 2001 From: raclim Date: Tue, 3 Dec 2024 00:55:50 -0500 Subject: [PATCH 23/33] 2.15.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d1b8cecf9..3235c91550 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "p5.js-web-editor", - "version": "2.15.4", + "version": "2.15.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "p5.js-web-editor", - "version": "2.15.4", + "version": "2.15.5", "license": "LGPL-2.1", "dependencies": { "@auth0/s3": "^1.0.0", diff --git a/package.json b/package.json index 03c93a5be7..8d26a46a4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p5.js-web-editor", - "version": "2.15.4", + "version": "2.15.5", "description": "The web editor for p5.js.", "scripts": { "clean": "rimraf dist", From 16644f3de1904bcf8418e99d6a6027e661afc87a Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 10:42:18 -0500 Subject: [PATCH 24/33] add apple pay id --- static/.well-known/apple-developer-merchantid-domain-association | 1 + 1 file changed, 1 insertion(+) create mode 100644 static/.well-known/apple-developer-merchantid-domain-association diff --git a/static/.well-known/apple-developer-merchantid-domain-association b/static/.well-known/apple-developer-merchantid-domain-association new file mode 100644 index 0000000000..2ff95c9628 --- /dev/null +++ b/static/.well-known/apple-developer-merchantid-domain-association @@ -0,0 +1 @@ +7B227073704964223A2239373943394538343346343131343044463144313834343232393232313734313034353044314339464446394437384337313531303944334643463542433731222C2276657273696F6E223A312C22637265617465644F6E223A313536363233343735303036312C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038346333303431343935313964353433363330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313339333033353331333833303331333333323335333735613137306433323334333033353331333633303331333333323335333735613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306265303935373166653731653165373335623535653561666163623463373266656234343566333031383532323263373235313030326236316562643666353530323231303064313862333530613564643664643665623137343630333562313165623263653837636661336536616636636264383338303839306463383263646461613633333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383463333034313439353139643534333633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303338333133393331333733313332333333303561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323062303731303365313430613462386231376262613230316130336163643036396234653431366232613263383066383661383338313435633239373566633131333030613036303832613836343863653364303430333032303434363330343430323230343639306264636637626461663833636466343934396534633035313039656463663334373665303564373261313264376335666538633033303033343464663032323032363764353863393365626233353031333836363062353730373938613064643731313734316262353864626436613138363633353038353431656565393035303030303030303030303030227D \ No newline at end of file From 944447001789bad56c64241ee61d41309bc28335 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 12:19:24 -0500 Subject: [PATCH 25/33] remove static folder --- .well-known/apple-developer-merchantid-domain-association | 1 + 1 file changed, 1 insertion(+) create mode 100644 .well-known/apple-developer-merchantid-domain-association diff --git a/.well-known/apple-developer-merchantid-domain-association b/.well-known/apple-developer-merchantid-domain-association new file mode 100644 index 0000000000..2ff95c9628 --- /dev/null +++ b/.well-known/apple-developer-merchantid-domain-association @@ -0,0 +1 @@ +7B227073704964223A2239373943394538343346343131343044463144313834343232393232313734313034353044314339464446394437384337313531303944334643463542433731222C2276657273696F6E223A312C22637265617465644F6E223A313536363233343735303036312C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038346333303431343935313964353433363330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313339333033353331333833303331333333323335333735613137306433323334333033353331333633303331333333323335333735613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306265303935373166653731653165373335623535653561666163623463373266656234343566333031383532323263373235313030326236316562643666353530323231303064313862333530613564643664643665623137343630333562313165623263653837636661336536616636636264383338303839306463383263646461613633333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383463333034313439353139643534333633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303338333133393331333733313332333333303561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323062303731303365313430613462386231376262613230316130336163643036396234653431366232613263383066383661383338313435633239373566633131333030613036303832613836343863653364303430333032303434363330343430323230343639306264636637626461663833636466343934396534633035313039656463663334373665303564373261313264376335666538633033303033343464663032323032363764353863393365626233353031333836363062353730373938613064643731313734316262353864626436613138363633353038353431656565393035303030303030303030303030227D \ No newline at end of file From 060b13adf3c2ba37aa83b613b3a30d9647008984 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 12:20:38 -0500 Subject: [PATCH 26/33] actually delete the static folder --- static/.well-known/apple-developer-merchantid-domain-association | 1 - 1 file changed, 1 deletion(-) delete mode 100644 static/.well-known/apple-developer-merchantid-domain-association diff --git a/static/.well-known/apple-developer-merchantid-domain-association b/static/.well-known/apple-developer-merchantid-domain-association deleted file mode 100644 index 2ff95c9628..0000000000 --- a/static/.well-known/apple-developer-merchantid-domain-association +++ /dev/null @@ -1 +0,0 @@ -7B227073704964223A2239373943394538343346343131343044463144313834343232393232313734313034353044314339464446394437384337313531303944334643463542433731222C2276657273696F6E223A312C22637265617465644F6E223A313536363233343735303036312C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038346333303431343935313964353433363330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313339333033353331333833303331333333323335333735613137306433323334333033353331333633303331333333323335333735613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306265303935373166653731653165373335623535653561666163623463373266656234343566333031383532323263373235313030326236316562643666353530323231303064313862333530613564643664643665623137343630333562313165623263653837636661336536616636636264383338303839306463383263646461613633333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383463333034313439353139643534333633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303338333133393331333733313332333333303561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323062303731303365313430613462386231376262613230316130336163643036396234653431366232613263383066383661383338313435633239373566633131333030613036303832613836343863653364303430333032303434363330343430323230343639306264636637626461663833636466343934396534633035313039656463663334373665303564373261313264376335666538633033303033343464663032323032363764353863393365626233353031333836363062353730373938613064643731313734316262353864626436613138363633353038353431656565393035303030303030303030303030227D \ No newline at end of file From 096edb816280fcfd1b32726a6b57ced654626e82 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 12:53:07 -0500 Subject: [PATCH 27/33] move to public folder --- .../.well-known}/apple-developer-merchantid-domain-association | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.well-known => public/.well-known}/apple-developer-merchantid-domain-association (100%) diff --git a/.well-known/apple-developer-merchantid-domain-association b/public/.well-known/apple-developer-merchantid-domain-association similarity index 100% rename from .well-known/apple-developer-merchantid-domain-association rename to public/.well-known/apple-developer-merchantid-domain-association From 89a81d8638f513b900ad80d46f5725be26bac898 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 13:42:45 -0500 Subject: [PATCH 28/33] ensure content type is set correctly in server --- server/server.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/server/server.js b/server/server.js index 8b4d196451..cfa0c69a15 100644 --- a/server/server.js +++ b/server/server.js @@ -125,6 +125,27 @@ if (process.env.BASIC_USERNAME && process.env.BASIC_PASSWORD) { ); } +// routing to serve files in .well-known with specific content type +// temporary addition for the apple pay integration with donorbox +app.use( + '/.well-known/apple-developer-merchantid-domain-association', + (req, res, next) => { + const filePath = path.join( + __dirname, + '../public/.well-known/apple-developer-merchantid-domain-association' + ); + + res.setHeader('Content-Type', 'text/plain'); + + res.sendFile(filePath, (err) => { + if (err) { + console.error('Error serving file:', err); + next(err); + } + }); + } +); + // Body parser, cookie parser, sessions, serve public assets app.use( '/locales', From 41b10f9393efc03ef9044720d2a4738d010cc0a6 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 15:09:59 -0500 Subject: [PATCH 29/33] set absolute path --- server/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/server.js b/server/server.js index cfa0c69a15..ce33b047d9 100644 --- a/server/server.js +++ b/server/server.js @@ -130,7 +130,7 @@ if (process.env.BASIC_USERNAME && process.env.BASIC_PASSWORD) { app.use( '/.well-known/apple-developer-merchantid-domain-association', (req, res, next) => { - const filePath = path.join( + const filePath = path.resolve( __dirname, '../public/.well-known/apple-developer-merchantid-domain-association' ); From 50077b63f422f511ddb63ab361cd4a8913c0d5c8 Mon Sep 17 00:00:00 2001 From: raclim Date: Wed, 4 Dec 2024 15:38:40 -0500 Subject: [PATCH 30/33] explicitly set root path --- server/server.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/server.js b/server/server.js index ce33b047d9..2226a42749 100644 --- a/server/server.js +++ b/server/server.js @@ -130,14 +130,12 @@ if (process.env.BASIC_USERNAME && process.env.BASIC_PASSWORD) { app.use( '/.well-known/apple-developer-merchantid-domain-association', (req, res, next) => { - const filePath = path.resolve( - __dirname, - '../public/.well-known/apple-developer-merchantid-domain-association' - ); + const rootPath = path.resolve(__dirname, '../public/.well-known'); + const fileName = 'apple-developer-merchantid-domain-association'; res.setHeader('Content-Type', 'text/plain'); - res.sendFile(filePath, (err) => { + res.sendFile(fileName, { root: rootPath }, (err) => { if (err) { console.error('Error serving file:', err); next(err); From 043eb44c23c3265c50edeff191d17539311bf25d Mon Sep 17 00:00:00 2001 From: raclim Date: Thu, 5 Dec 2024 09:30:18 -0500 Subject: [PATCH 31/33] remove apple pay setup in server --- server/server.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/server/server.js b/server/server.js index 2226a42749..8b4d196451 100644 --- a/server/server.js +++ b/server/server.js @@ -125,25 +125,6 @@ if (process.env.BASIC_USERNAME && process.env.BASIC_PASSWORD) { ); } -// routing to serve files in .well-known with specific content type -// temporary addition for the apple pay integration with donorbox -app.use( - '/.well-known/apple-developer-merchantid-domain-association', - (req, res, next) => { - const rootPath = path.resolve(__dirname, '../public/.well-known'); - const fileName = 'apple-developer-merchantid-domain-association'; - - res.setHeader('Content-Type', 'text/plain'); - - res.sendFile(fileName, { root: rootPath }, (err) => { - if (err) { - console.error('Error serving file:', err); - next(err); - } - }); - } -); - // Body parser, cookie parser, sessions, serve public assets app.use( '/locales', From 71fd59e9f15e7f2eac58529012113f0f58974094 Mon Sep 17 00:00:00 2001 From: raclim Date: Thu, 5 Dec 2024 09:47:15 -0500 Subject: [PATCH 32/33] 2.15.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3235c91550..83bed02c1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "p5.js-web-editor", - "version": "2.15.5", + "version": "2.15.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "p5.js-web-editor", - "version": "2.15.5", + "version": "2.15.6", "license": "LGPL-2.1", "dependencies": { "@auth0/s3": "^1.0.0", diff --git a/package.json b/package.json index 8d26a46a4a..5bf70189ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p5.js-web-editor", - "version": "2.15.5", + "version": "2.15.6", "description": "The web editor for p5.js.", "scripts": { "clean": "rimraf dist", From d42872fb495e52eb2f9b8968803678e56593feb8 Mon Sep 17 00:00:00 2001 From: raclim <43053081+raclim@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:30:16 -0500 Subject: [PATCH 33/33] Remove Icon from README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 36d7195f88..1314340425 100644 --- a/README.md +++ b/README.md @@ -46,5 +46,3 @@ Hosting and technical support has come from:
            -
            -