excalidraw/src/components
Aakansha Doshi 8420aecb34
feat: new Menu Component API (#6034)
* feat: new Menu Component API

* allow valid children types

* introduce menu group to group items

* Add lang footer

* use display name

* displayName

* define types inside

* fix default menu

* add json export to menu

* fix

* simplify expression

* put open menu into own compo to optimize perf

So that we don't rerun `useOutsideClickHook` (and rebind event listeners
all the time)

* naming tweaks

* rename MenuComponents->MenuDefaultItems and export default items from Menu.Items

* import Menu.scss in Menu.tsx

* move menu scss to excal app

* Don't filter children inside menu group

* move E+ out of socials

* support style prop for MenuItem and MenuGroup

* Support header in menu group and add Excalidraw links header for default items in social section

* rename header to title

* fix padding for lang

* render menu in mobile

* review fixes

* tweaks

* Export collaborators and show in mobile menu

* revert .env

* lint :p

* again lint

* show correct actions in view mode for mobile

* Whitelist Collaborators Comp

* mobile styling

* padding

* don't show nerds when menu open in mobile

* lint :(

* hide shortcuts

* refactor userlist to support mobile and keep a wrapper comp for excal app

* use only UserList

* render only on mobile for default items

* remove unused hooks

* Show collab button in menu when onCollabButtonClick present and hide export when UIOptions.canvasActions.export is false

* fix tests

* lint

* inject userlist inside menu on mobile

* revert userlist

* move menu socials to default menu

* fix collab

* use meny in library

* Make Menu generic and create hamburgemenu for public excal menu and use menu in library as well

* use appState.openMenu for mobile

* fix tests

* styling fixes and support style and class name in menu content

* fix test

* rename MenuDefaultItems->DefaultItems

* move footer css to its own comp

* rename HamburgerMenu -> MainMenu

* rename menu -> dropdownMenu and update classes, onClick->onToggle

* close main menu when dialog closes

* by bye filtering

* update docs

* fix lint

* update example, docs for useDevice and footer in mobile, rename menu ->DropDownMenu everywhere

* spec

* remove isMenuOpenAtom and set openMenu as canvas for main menu, render decreases in specs :)

* [temp] remove cyclic depenedency to fix build

* hack- update appstate to sync lang change

* Add more specs

* wip: rewrite MainMenu footer

* fix margin

* fix snaps

* not needed as lang list no more imported

* simplify custom footer rendering

* Add DropdownMenuItemLink and DropdownMenuItemCustom and update API, docs

* fix `MainMenu.ItemCustom`

* naming

* use onSelect and base class for custom items

* fix lint

* fix snap

* use custom item for lang

* update docs

* fix

* properly use `MainMenu.ItemCustom` for `LanguageList`

* add margin top to custom items

* flex

Co-authored-by: dwelle <luzar.david@gmail.com>
2023-01-05 22:04:23 +05:30
..
dropdownMenu feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
footer feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
hoc feat: refactor Sidebar into standalone reusable component (#5663) 2022-10-17 12:25:24 +02:00
mainMenu feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
Sidebar feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
Actions.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Actions.tsx feat: better default radius sizes for rectangles (#5553) 2022-12-08 16:48:49 +01:00
ActiveFile.scss feat: Show active file name when saving to current file (#3733) 2021-06-13 21:11:07 +05:30
ActiveFile.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
App.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
Avatar.scss fix: Avatar outline on safari & center (#5997) 2022-12-16 18:18:34 +01:00
Avatar.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
ButtonIconCycle.tsx refactor: Use arrow function where possible (#3315) 2021-03-29 17:09:20 +03:00
ButtonIconSelect.tsx fix: changing font size when text is not selected or edited (#4751) 2022-02-08 21:18:43 +00:00
ButtonSelect.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
Card.scss feat: image support (#4011) 2021-10-21 22:05:48 +02:00
Card.tsx chore: upgrade to React 18 (#5450) 2022-07-22 11:20:36 +05:30
CheckboxItem.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
CheckboxItem.tsx chore: upgrade to React 18 (#5450) 2022-07-22 11:20:36 +05:30
ClearCanvas.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
CollabButton.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
CollabButton.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
ColorPicker.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
ColorPicker.tsx fix: ColorPicker getColor (#5949) 2022-12-22 12:53:49 +00:00
ConfirmDialog.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
ConfirmDialog.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
ContextMenu.scss feat: move contextMenu into the component tree and control via appState (#6021) 2022-12-21 12:47:09 +01:00
ContextMenu.tsx feat: move contextMenu into the component tree and control via appState (#6021) 2022-12-21 12:47:09 +01:00
DarkModeToggle.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
Dialog.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Dialog.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
DialogActionButton.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
DialogActionButton.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
ErrorDialog.tsx fix: use excal id so every element has unique id (#3696) 2021-06-10 02:46:56 +05:30
ExportDialog.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
FixedSideContainer.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
FixedSideContainer.tsx Add and use clsx (classnames alternative) (#2249) 2020-10-19 16:14:28 +02:00
HelpButton.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
HelpDialog.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
HelpDialog.tsx feat: Scroll using PageUp and PageDown (#6038) 2022-12-31 15:54:37 -06:00
HintViewer.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
HintViewer.tsx feat: refactor Sidebar into standalone reusable component (#5663) 2022-10-17 12:25:24 +02:00
IconPicker.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
IconPicker.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
icons.tsx fix: SVG element attributes in icons.tsx (#5871) 2022-11-14 11:42:28 +05:30
ImageExportDialog.tsx fix: remove legacy React.render() from the editor (#5893) 2022-11-19 18:27:54 +01:00
InitializeApp.tsx fix: default light theme splash 🔧 (#5660) 2022-09-16 13:59:03 +00:00
Island.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Island.tsx Fix padding in the library loading buttons (#2331) 2020-11-04 11:05:12 +01:00
JSONExportDialog.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
LayerUI.scss feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
LayerUI.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
LibraryButton.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryButton.tsx feat: tweak toolbar shortcuts & remove library shortcut (#5832) 2022-11-06 20:14:53 +01:00
LibraryMenu.scss feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
LibraryMenu.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryMenuBrowseButton.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryMenuHeaderContent.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
LibraryMenuItems.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryMenuItems.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryUnit.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
LibraryUnit.tsx fix: stop font loadingdone loop when rendering element SVGs (#5883) 2022-11-15 21:02:57 +01:00
LoadingMessage.tsx fix: default light theme splash 🔧 (#5660) 2022-09-16 13:59:03 +00:00
LockButton.tsx fix: incorrectly selecting linear elements on creation while tool-locked (#5785) 2022-11-02 14:38:58 +01:00
MobileMenu.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
Modal.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Modal.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
PasteChartDialog.scss feat: use component dimensions to break to mobile (#3414) 2021-04-08 19:54:50 +02:00
PasteChartDialog.tsx fix: stop font loadingdone loop when rendering element SVGs (#5883) 2022-11-15 21:02:57 +01:00
PenModeButton.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Popover.scss feat: make context menu scrollable (#4030) 2022-07-21 14:34:49 +02:00
Popover.tsx fix: Context menu positioning when component has offsets (#5520) 2022-08-02 11:38:55 +05:30
ProjectName.scss feat: exporting redesign (#3613) 2021-05-25 21:37:14 +02:00
ProjectName.tsx feat: Allow publishing libraries from UI (#4115) 2021-11-17 23:53:43 +05:30
PublishLibrary.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
PublishLibrary.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Section.tsx chore: upgrade to React 18 (#5450) 2022-07-22 11:20:36 +05:30
SingleLibraryItem.scss feat: support resubmitting published library items (#5174) 2022-05-11 15:56:11 +02:00
SingleLibraryItem.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Spinner.scss feat: image support (#4011) 2021-10-21 22:05:48 +02:00
Spinner.tsx feat: image support (#4011) 2021-10-21 22:05:48 +02:00
Stack.scss scope css under name space excalidraw (#1983) 2020-09-25 23:18:45 +02:00
Stack.tsx feat: add sidebar for libraries panel (#5274) 2022-06-21 17:03:23 +02:00
Stats.scss feat: add sidebar for libraries panel (#5274) 2022-06-21 17:03:23 +02:00
Stats.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
TextInput.scss feat: Allow publishing libraries from UI (#4115) 2021-11-17 23:53:43 +05:30
Toast.scss feat: make toast closable and allow custom duration (#5308) 2022-07-05 21:43:59 +05:30
Toast.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Toolbar.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
ToolButton.tsx fix: Add display name to components so it doesn't show as anonymous (#5616) 2022-08-26 11:46:19 +05:30
ToolIcon.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
Tooltip.scss feat: support src collaborators (#5114) 2022-05-02 15:15:24 +05:30
Tooltip.tsx feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
TopErrorBoundary.tsx chore: Update Typescript to 4.4.4 (#4188) 2021-11-02 14:24:16 +02:00
UserList.scss fix: Avatar outline on safari & center (#5997) 2022-12-16 18:18:34 +01:00
UserList.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
WelcomeScreen.scss feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00
WelcomeScreen.tsx feat: new Menu Component API (#6034) 2023-01-05 22:04:23 +05:30
WelcomeScreenDecor.tsx feat: editor redesign 🔥 (#5780) 2022-11-01 17:29:58 +01:00