From d918df698bcd8cf37aa241e9f3e06f35c91d0526 Mon Sep 17 00:00:00 2001 From: CulturalProfessor Date: Wed, 26 Jul 2023 14:36:09 +0530 Subject: [PATCH 1/9] excalidraw folder initialized --- .../excalidraw/actions/actionAddToLibrary.ts | 60 + client/excalidraw/actions/actionAlign.tsx | 216 + client/excalidraw/actions/actionBoundText.tsx | 313 + client/excalidraw/actions/actionCanvas.tsx | 377 + client/excalidraw/actions/actionClipboard.tsx | 198 + .../actions/actionDeleteSelected.tsx | 170 + .../excalidraw/actions/actionDistribute.tsx | 96 + .../actions/actionDuplicateSelection.tsx | 223 + client/excalidraw/actions/actionExport.tsx | 283 + client/excalidraw/actions/actionFinalize.tsx | 211 + client/excalidraw/actions/actionFlip.ts | 247 + client/excalidraw/actions/actionGroup.tsx | 208 + client/excalidraw/actions/actionHistory.tsx | 105 + .../excalidraw/actions/actionLinearEditor.ts | 49 + client/excalidraw/actions/actionMenu.tsx | 90 + client/excalidraw/actions/actionNavigate.tsx | 49 + .../excalidraw/actions/actionProperties.tsx | 1085 + client/excalidraw/actions/actionSelectAll.ts | 50 + .../excalidraw/actions/actionStyles.test.tsx | 71 + client/excalidraw/actions/actionStyles.ts | 140 + .../actions/actionToggleGridMode.tsx | 28 + client/excalidraw/actions/actionToggleLock.ts | 60 + .../excalidraw/actions/actionToggleStats.tsx | 21 + .../actions/actionToggleViewMode.tsx | 27 + .../actions/actionToggleZenMode.tsx | 27 + client/excalidraw/actions/actionZindex.tsx | 145 + client/excalidraw/actions/index.ts | 88 + client/excalidraw/actions/manager.tsx | 185 + client/excalidraw/actions/register.ts | 10 + client/excalidraw/actions/shortcuts.ts | 90 + client/excalidraw/actions/types.ts | 173 + client/excalidraw/align.ts | 62 + client/excalidraw/analytics.ts | 30 + client/excalidraw/appState.ts | 239 + client/excalidraw/bug-issue-template.js | 11 + client/excalidraw/charts.test.ts | 121 + client/excalidraw/charts.ts | 478 + client/excalidraw/clients.ts | 28 + client/excalidraw/clipboard.test.ts | 27 + client/excalidraw/clipboard.ts | 267 + client/excalidraw/colors.ts | 22 + client/excalidraw/components/Actions.scss | 92 + client/excalidraw/components/Actions.tsx | 338 + .../components/ActiveConfirmDialog.tsx | 37 + client/excalidraw/components/App.test.tsx | 45 + client/excalidraw/components/App.tsx | 6606 ++++++ client/excalidraw/components/Avatar.scss | 36 + client/excalidraw/components/Avatar.tsx | 34 + .../components/BraveMeasureTextError.tsx | 42 + client/excalidraw/components/Button.scss | 7 + client/excalidraw/components/Button.tsx | 35 + .../excalidraw/components/ButtonIconCycle.tsx | 28 + .../components/ButtonIconSelect.tsx | 59 + client/excalidraw/components/ButtonSelect.tsx | 30 + client/excalidraw/components/Card.scss | 57 + client/excalidraw/components/Card.tsx | 28 + .../excalidraw/components/CheckboxItem.scss | 91 + client/excalidraw/components/CheckboxItem.tsx | 31 + client/excalidraw/components/ColorPicker.scss | 284 + client/excalidraw/components/ColorPicker.tsx | 430 + .../excalidraw/components/ConfirmDialog.scss | 11 + .../excalidraw/components/ConfirmDialog.tsx | 60 + client/excalidraw/components/ContextMenu.scss | 97 + client/excalidraw/components/ContextMenu.tsx | 124 + .../excalidraw/components/DarkModeToggle.tsx | 50 + client/excalidraw/components/Dialog.scss | 17 + client/excalidraw/components/Dialog.tsx | 110 + .../components/DialogActionButton.scss | 47 + .../components/DialogActionButton.tsx | 46 + client/excalidraw/components/ErrorDialog.tsx | 40 + .../excalidraw/components/ExportDialog.scss | 129 + .../components/FixedSideContainer.scss | 40 + .../components/FixedSideContainer.tsx | 26 + client/excalidraw/components/HandButton.tsx | 32 + client/excalidraw/components/HelpButton.tsx | 20 + client/excalidraw/components/HelpDialog.scss | 115 + client/excalidraw/components/HelpDialog.tsx | 444 + client/excalidraw/components/HintViewer.scss | 37 + client/excalidraw/components/HintViewer.tsx | 139 + client/excalidraw/components/IconPicker.scss | 143 + client/excalidraw/components/IconPicker.tsx | 192 + .../components/ImageExportDialog.tsx | 252 + .../excalidraw/components/InitializeApp.tsx | 27 + client/excalidraw/components/Island.scss | 16 + client/excalidraw/components/Island.tsx | 23 + .../components/JSONExportDialog.tsx | 127 + client/excalidraw/components/LayerUI.scss | 94 + client/excalidraw/components/LayerUI.tsx | 516 + .../excalidraw/components/LibraryButton.scss | 32 + .../excalidraw/components/LibraryButton.tsx | 57 + client/excalidraw/components/LibraryMenu.scss | 155 + client/excalidraw/components/LibraryMenu.tsx | 309 + .../components/LibraryMenuBrowseButton.tsx | 31 + .../components/LibraryMenuHeaderContent.tsx | 263 + .../components/LibraryMenuItems.scss | 78 + .../components/LibraryMenuItems.tsx | 317 + client/excalidraw/components/LibraryUnit.scss | 145 + client/excalidraw/components/LibraryUnit.tsx | 108 + .../excalidraw/components/LoadingMessage.tsx | 40 + client/excalidraw/components/LockButton.tsx | 48 + client/excalidraw/components/MobileMenu.tsx | 210 + client/excalidraw/components/Modal.scss | 110 + client/excalidraw/components/Modal.tsx | 98 + .../components/PasteChartDialog.scss | 46 + .../components/PasteChartDialog.tsx | 130 + .../excalidraw/components/PenModeButton.tsx | 46 + client/excalidraw/components/Popover.scss | 8 + client/excalidraw/components/Popover.tsx | 152 + client/excalidraw/components/ProjectName.scss | 25 + client/excalidraw/components/ProjectName.tsx | 60 + .../excalidraw/components/PublishLibrary.scss | 172 + .../excalidraw/components/PublishLibrary.tsx | 552 + client/excalidraw/components/Section.tsx | 28 + .../components/Sidebar/Sidebar.scss | 128 + .../components/Sidebar/Sidebar.test.tsx | 355 + .../excalidraw/components/Sidebar/Sidebar.tsx | 151 + .../components/Sidebar/SidebarHeader.tsx | 89 + .../excalidraw/components/Sidebar/common.ts | 23 + client/excalidraw/components/Spinner.scss | 48 + client/excalidraw/components/Spinner.tsx | 28 + client/excalidraw/components/Stack.scss | 19 + client/excalidraw/components/Stack.tsx | 64 + client/excalidraw/components/Stats.scss | 54 + client/excalidraw/components/Stats.tsx | 108 + client/excalidraw/components/TextInput.scss | 7 + client/excalidraw/components/Toast.scss | 49 + client/excalidraw/components/Toast.tsx | 59 + client/excalidraw/components/ToolButton.tsx | 191 + client/excalidraw/components/ToolIcon.scss | 174 + client/excalidraw/components/Toolbar.scss | 21 + client/excalidraw/components/Tooltip.scss | 44 + client/excalidraw/components/Tooltip.tsx | 114 + .../components/TopErrorBoundary.tsx | 136 + client/excalidraw/components/UserList.scss | 37 + client/excalidraw/components/UserList.tsx | 52 + .../__snapshots__/App.test.tsx.snap | 63 + .../excalidraw/components/context/tunnels.ts | 32 + .../components/dropdownMenu/DropdownMenu.scss | 127 + .../components/dropdownMenu/DropdownMenu.tsx | 43 + .../dropdownMenu/DropdownMenuContent.tsx | 62 + .../dropdownMenu/DropdownMenuGroup.tsx | 23 + .../dropdownMenu/DropdownMenuItem.tsx | 40 + .../dropdownMenu/DropdownMenuItemContent.tsx | 23 + .../dropdownMenu/DropdownMenuItemCustom.tsx | 21 + .../dropdownMenu/DropdownMenuItemLink.tsx | 44 + .../dropdownMenu/DropdownMenuSeparator.tsx | 14 + .../dropdownMenu/DropdownMenuTrigger.tsx | 37 + .../components/dropdownMenu/common.ts | 31 + .../dropdownMenu/dropdownMenuUtils.ts | 35 + .../excalidraw/components/footer/Footer.tsx | 95 + .../components/footer/FooterCenter.scss | 10 + .../components/footer/FooterCenter.tsx | 24 + .../components/hoc/withInternalFallback.tsx | 52 + .../components/hoc/withUpstreamOverride.tsx | 63 + client/excalidraw/components/icons.tsx | 1552 ++ .../LiveCollaborationTrigger.scss | 70 + .../LiveCollaborationTrigger.tsx | 40 + .../components/main-menu/DefaultItems.scss | 21 + .../components/main-menu/DefaultItems.tsx | 261 + .../components/main-menu/MainMenu.tsx | 84 + .../welcome-screen/WelcomeScreen.Center.tsx | 196 + .../welcome-screen/WelcomeScreen.Hints.tsx | 52 + .../welcome-screen/WelcomeScreen.scss | 284 + .../welcome-screen/WelcomeScreen.tsx | 26 + client/excalidraw/constants.ts | 277 + client/excalidraw/css.d.ts | 10 + client/excalidraw/css/app.scss | 39 + client/excalidraw/css/styles.scss | 648 + client/excalidraw/css/theme.scss | 174 + client/excalidraw/css/variables.module.scss | 103 + client/excalidraw/data/blob.ts | 453 + client/excalidraw/data/encode.ts | 391 + client/excalidraw/data/encryption.ts | 93 + client/excalidraw/data/filesystem.ts | 111 + client/excalidraw/data/image.ts | 122 + client/excalidraw/data/index.ts | 125 + client/excalidraw/data/json.ts | 153 + client/excalidraw/data/library.ts | 455 + client/excalidraw/data/resave.ts | 40 + client/excalidraw/data/restore.ts | 592 + client/excalidraw/data/types.ts | 61 + client/excalidraw/distribute.ts | 90 + client/excalidraw/element/Hyperlink.scss | 74 + client/excalidraw/element/Hyperlink.tsx | 467 + client/excalidraw/element/binding.ts | 746 + client/excalidraw/element/bounds.test.ts | 114 + client/excalidraw/element/bounds.ts | 657 + client/excalidraw/element/collision.ts | 956 + client/excalidraw/element/dragElements.ts | 153 + client/excalidraw/element/image.ts | 125 + client/excalidraw/element/index.ts | 100 + .../excalidraw/element/linearElementEditor.ts | 1479 ++ client/excalidraw/element/mutateElement.ts | 151 + client/excalidraw/element/newElement.test.ts | 368 + client/excalidraw/element/newElement.ts | 632 + client/excalidraw/element/resizeElements.ts | 854 + client/excalidraw/element/resizeTest.ts | 171 + .../element/showSelectedShapeActions.ts | 17 + client/excalidraw/element/sizeHelpers.test.ts | 51 + client/excalidraw/element/sizeHelpers.ts | 151 + .../excalidraw/element/sortElements.test.ts | 402 + client/excalidraw/element/sortElements.ts | 123 + client/excalidraw/element/textElement.test.ts | 344 + client/excalidraw/element/textElement.ts | 957 + .../excalidraw/element/textWysiwyg.test.tsx | 1515 ++ client/excalidraw/element/textWysiwyg.tsx | 716 + client/excalidraw/element/transformHandles.ts | 282 + client/excalidraw/element/typeChecks.test.ts | 66 + client/excalidraw/element/typeChecks.ts | 207 + client/excalidraw/element/types.ts | 197 + client/excalidraw/errors.ts | 18 + .../excalidraw/excalidraw-app/CustomStats.tsx | 89 + client/excalidraw/excalidraw-app/app-jotai.ts | 3 + .../excalidraw-app/app_constants.ts | 48 + .../excalidraw-app/collab/Collab.tsx | 870 + .../excalidraw-app/collab/Portal.tsx | 224 + .../excalidraw-app/collab/RoomDialog.scss | 76 + .../excalidraw-app/collab/RoomDialog.tsx | 190 + .../excalidraw-app/collab/reconciliation.ts | 154 + .../excalidraw-app/components/AppFooter.tsx | 21 + .../excalidraw-app/components/AppMainMenu.tsx | 40 + .../components/AppWelcomeScreen.tsx | 65 + .../components/EncryptedIcon.tsx | 21 + .../components/ExcalidrawPlusAppLink.tsx | 17 + .../components/ExportToExcalidrawPlus.tsx | 110 + .../components/GitHubCorner.tsx | 45 + .../components/LanguageList.tsx | 29 + .../excalidraw-app/components/icons.tsx | 19 + .../excalidraw-app/data/FileManager.ts | 242 + .../excalidraw-app/data/LocalData.ts | 178 + .../excalidraw/excalidraw-app/data/Locker.ts | 18 + .../excalidraw-app/data/firebase.ts | 347 + .../excalidraw/excalidraw-app/data/index.ts | 340 + .../excalidraw-app/data/localStorage.ts | 115 + .../excalidraw/excalidraw-app/data/tabSync.ts | 29 + client/excalidraw/excalidraw-app/index.scss | 104 + client/excalidraw/excalidraw-app/index.tsx | 694 + client/excalidraw/excalidraw-app/pwa.ts | 31 + client/excalidraw/excalidraw-app/sentry.ts | 39 + client/excalidraw/ga.ts | 317 + client/excalidraw/gadirections.ts | 26 + client/excalidraw/galines.ts | 52 + client/excalidraw/gapoints.ts | 41 + client/excalidraw/gatransforms.ts | 41 + client/excalidraw/gesture.ts | 15 + client/excalidraw/global.d.ts | 122 + client/excalidraw/groups.ts | 188 + client/excalidraw/history.ts | 265 + .../excalidraw/hooks/useCallbackRefState.ts | 7 + client/excalidraw/hooks/useOutsideClick.ts | 42 + client/excalidraw/i18n.ts | 161 + client/excalidraw/index-node.ts | 83 + client/excalidraw/index.tsx | 14 + client/excalidraw/jotai.ts | 27 + client/excalidraw/keys.ts | 95 + client/excalidraw/locales/README.md | 12 + client/excalidraw/locales/ar-SA.json | 482 + client/excalidraw/locales/bg-BG.json | 482 + client/excalidraw/locales/bn-BD.json | 482 + client/excalidraw/locales/ca-ES.json | 482 + client/excalidraw/locales/cs-CZ.json | 482 + client/excalidraw/locales/da-DK.json | 482 + client/excalidraw/locales/de-DE.json | 482 + client/excalidraw/locales/el-GR.json | 482 + client/excalidraw/locales/en.json | 482 + client/excalidraw/locales/es-ES.json | 482 + client/excalidraw/locales/eu-ES.json | 482 + client/excalidraw/locales/fa-IR.json | 482 + client/excalidraw/locales/fi-FI.json | 482 + client/excalidraw/locales/fr-FR.json | 482 + client/excalidraw/locales/gl-ES.json | 482 + client/excalidraw/locales/he-IL.json | 482 + client/excalidraw/locales/hi-IN.json | 482 + client/excalidraw/locales/hu-HU.json | 482 + client/excalidraw/locales/id-ID.json | 482 + client/excalidraw/locales/it-IT.json | 482 + client/excalidraw/locales/ja-JP.json | 482 + client/excalidraw/locales/kab-KAB.json | 482 + client/excalidraw/locales/kk-KZ.json | 482 + client/excalidraw/locales/ko-KR.json | 482 + client/excalidraw/locales/ku-TR.json | 482 + client/excalidraw/locales/lt-LT.json | 482 + client/excalidraw/locales/lv-LV.json | 482 + client/excalidraw/locales/mr-IN.json | 482 + client/excalidraw/locales/my-MM.json | 482 + client/excalidraw/locales/nb-NO.json | 482 + client/excalidraw/locales/nl-NL.json | 482 + client/excalidraw/locales/nn-NO.json | 482 + client/excalidraw/locales/oc-FR.json | 482 + client/excalidraw/locales/pa-IN.json | 482 + client/excalidraw/locales/percentages.json | 53 + client/excalidraw/locales/pl-PL.json | 482 + client/excalidraw/locales/pt-BR.json | 482 + client/excalidraw/locales/pt-PT.json | 482 + client/excalidraw/locales/ro-RO.json | 482 + client/excalidraw/locales/ru-RU.json | 482 + client/excalidraw/locales/si-LK.json | 482 + client/excalidraw/locales/sk-SK.json | 482 + client/excalidraw/locales/sl-SI.json | 482 + client/excalidraw/locales/sv-SE.json | 482 + client/excalidraw/locales/ta-IN.json | 482 + client/excalidraw/locales/th-TH.json | 482 + client/excalidraw/locales/tr-TR.json | 482 + client/excalidraw/locales/uk-UA.json | 482 + client/excalidraw/locales/vi-VN.json | 482 + client/excalidraw/locales/zh-CN.json | 482 + client/excalidraw/locales/zh-HK.json | 482 + client/excalidraw/locales/zh-TW.json | 482 + client/excalidraw/math.test.ts | 15 + client/excalidraw/math.ts | 474 + .../excalidraw/packages/excalidraw/.gitignore | 2 + .../packages/excalidraw/CHANGELOG.md | 1153 + .../excalidraw/packages/excalidraw/README.md | 45 + .../excalidraw/packages/excalidraw/entry.js | 7 + client/excalidraw/packages/excalidraw/env.js | 18 + .../packages/excalidraw/example/App.scss | 83 + .../packages/excalidraw/example/App.tsx | 816 + .../excalidraw/example/CustomFooter.tsx | 75 + .../excalidraw/example/MobileFooter.tsx | 20 + .../packages/excalidraw/example/index.tsx | 16 + .../excalidraw/example/initialData.js | 1300 + .../example/public/images/doremon.png | Bin 0 -> 201946 bytes .../example/public/images/excalibot.png | Bin 0 -> 30330 bytes .../example/public/images/pika.jpeg | Bin 0 -> 6250 bytes .../example/public/images/rocket.jpeg | Bin 0 -> 40368 bytes .../excalidraw/example/public/index.html | 29 + .../example/sidebar/ExampleSidebar.scss | 66 + .../example/sidebar/ExampleSidebar.tsx | 30 + .../excalidraw/packages/excalidraw/index.tsx | 247 + client/excalidraw/packages/excalidraw/main.js | 5 + .../packages/excalidraw/package.json | 84 + .../packages/excalidraw/publicPath.js | 8 + .../excalidraw/webpack.dev-server.config.js | 28 + .../packages/excalidraw/webpack.dev.config.js | 97 + .../excalidraw/webpack.prod.config.js | 119 + .../excalidraw/packages/excalidraw/yarn.lock | 3940 +++ client/excalidraw/packages/tsconfig.dev.json | 11 + client/excalidraw/packages/tsconfig.prod.json | 9 + client/excalidraw/packages/utils.ts | 244 + client/excalidraw/packages/utils/CHANGELOG.md | 11 + client/excalidraw/packages/utils/README.md | 99 + client/excalidraw/packages/utils/index.js | 1 + client/excalidraw/packages/utils/package.json | 62 + .../packages/utils/webpack.prod.config.js | 60 + client/excalidraw/packages/utils/yarn.lock | 2580 ++ client/excalidraw/points.ts | 55 + client/excalidraw/polyfill.ts | 26 + client/excalidraw/pwacompat.d.ts | 1 + client/excalidraw/random.ts | 15 + client/excalidraw/react-app-env.d.ts | 1 + client/excalidraw/renderer/renderElement.ts | 1468 ++ client/excalidraw/renderer/renderScene.ts | 1165 + client/excalidraw/renderer/roundRect.ts | 37 + client/excalidraw/scene/Fonts.ts | 93 + client/excalidraw/scene/Scene.ts | 173 + client/excalidraw/scene/comparisons.ts | 68 + client/excalidraw/scene/export.ts | 202 + client/excalidraw/scene/index.ts | 20 + client/excalidraw/scene/scroll.ts | 82 + client/excalidraw/scene/scrollbars.ts | 130 + client/excalidraw/scene/selection.ts | 81 + client/excalidraw/scene/types.ts | 62 + client/excalidraw/scene/zoom.ts | 40 + client/excalidraw/service-worker.ts | 147 + .../excalidraw/serviceWorkerRegistration.ts | 162 + client/excalidraw/setupTests.ts | 23 + client/excalidraw/shapes.tsx | 99 + client/excalidraw/tests/MobileMenu.test.tsx | 45 + .../__snapshots__/MobileMenu.test.tsx.snap | 240 + .../tests/__snapshots__/charts.test.tsx.snap | 20 + .../__snapshots__/contextmenu.test.tsx.snap | 6672 ++++++ .../__snapshots__/dragCreate.test.tsx.snap | 194 + .../tests/__snapshots__/export.test.tsx.snap | 20 + .../linearElementEditor.test.tsx.snap | 12 + .../tests/__snapshots__/move.test.tsx.snap | 220 + .../multiPointCreate.test.tsx.snap | 107 + .../regressionTests.test.tsx.snap | 19731 ++++++++++++++++ .../__snapshots__/selection.test.tsx.snap | 186 + client/excalidraw/tests/align.test.tsx | 580 + client/excalidraw/tests/appState.test.tsx | 75 + client/excalidraw/tests/binding.test.tsx | 312 + client/excalidraw/tests/charts.test.tsx | 13 + client/excalidraw/tests/clients.test.ts | 44 + client/excalidraw/tests/clipboard.test.tsx | 252 + client/excalidraw/tests/collab.test.tsx | 95 + client/excalidraw/tests/contextmenu.test.tsx | 585 + .../data/__snapshots__/restore.test.ts.snap | 359 + client/excalidraw/tests/data/restore.test.ts | 767 + client/excalidraw/tests/dragCreate.test.tsx | 304 + .../excalidraw/tests/elementLocking.test.tsx | 388 + client/excalidraw/tests/export.test.tsx | 178 + client/excalidraw/tests/fitToContent.test.tsx | 189 + client/excalidraw/tests/fixtures/deer.png | Bin 0 -> 12468 bytes .../tests/fixtures/diagramFixture.ts | 33 + .../tests/fixtures/elementFixture.ts | 45 + .../fixtures/fixture_library.excalidrawlib | 31 + client/excalidraw/tests/fixtures/smiley.png | Bin 0 -> 1255 bytes .../tests/fixtures/smiley_embedded_v2.png | Bin 0 -> 2097 bytes .../tests/fixtures/smiley_embedded_v2.svg | 16 + .../svg-image-exporting-reference.svg | 16 + .../tests/fixtures/test_embedded_v1.png | Bin 0 -> 1768 bytes .../tests/fixtures/test_embedded_v1.svg | 16 + client/excalidraw/tests/flip.test.tsx | 785 + .../excalidraw/tests/geometricAlgebra.test.ts | 70 + client/excalidraw/tests/helpers/api.ts | 295 + client/excalidraw/tests/helpers/ui.ts | 326 + client/excalidraw/tests/history.test.tsx | 188 + client/excalidraw/tests/library.test.tsx | 317 + .../tests/linearElementEditor.test.tsx | 1252 + client/excalidraw/tests/move.test.tsx | 153 + .../tests/multiPointCreate.test.tsx | 164 + .../__snapshots__/excalidraw.test.tsx.snap | 565 + .../packages/__snapshots__/utils.test.ts.snap | 83 + .../tests/packages/excalidraw.test.tsx | 391 + .../excalidraw/tests/packages/utils.test.ts | 134 + .../tests/packages/utils.unmocked.test.ts | 67 + .../excalidraw/tests/queries/toolQueries.ts | 38 + .../excalidraw/tests/reconciliation.test.ts | 422 + .../excalidraw/tests/regressionTests.test.tsx | 1185 + client/excalidraw/tests/resize.test.tsx | 151 + .../scene/__snapshots__/export.test.ts.snap | 112 + client/excalidraw/tests/scene/export.test.ts | 129 + client/excalidraw/tests/scroll.test.tsx | 112 + client/excalidraw/tests/selection.test.tsx | 399 + client/excalidraw/tests/shortcuts.test.tsx | 30 + client/excalidraw/tests/test-utils.ts | 192 + client/excalidraw/tests/utils.test.ts | 13 + client/excalidraw/tests/utils.ts | 48 + client/excalidraw/tests/viewMode.test.tsx | 57 + client/excalidraw/tests/zindex.test.tsx | 1184 + client/excalidraw/types.ts | 528 + client/excalidraw/utility-types.ts | 49 + client/excalidraw/utils.ts | 799 + client/excalidraw/zindex.ts | 349 + 434 files changed, 130827 insertions(+) create mode 100644 client/excalidraw/actions/actionAddToLibrary.ts create mode 100644 client/excalidraw/actions/actionAlign.tsx create mode 100644 client/excalidraw/actions/actionBoundText.tsx create mode 100644 client/excalidraw/actions/actionCanvas.tsx create mode 100644 client/excalidraw/actions/actionClipboard.tsx create mode 100644 client/excalidraw/actions/actionDeleteSelected.tsx create mode 100644 client/excalidraw/actions/actionDistribute.tsx create mode 100644 client/excalidraw/actions/actionDuplicateSelection.tsx create mode 100644 client/excalidraw/actions/actionExport.tsx create mode 100644 client/excalidraw/actions/actionFinalize.tsx create mode 100644 client/excalidraw/actions/actionFlip.ts create mode 100644 client/excalidraw/actions/actionGroup.tsx create mode 100644 client/excalidraw/actions/actionHistory.tsx create mode 100644 client/excalidraw/actions/actionLinearEditor.ts create mode 100644 client/excalidraw/actions/actionMenu.tsx create mode 100644 client/excalidraw/actions/actionNavigate.tsx create mode 100644 client/excalidraw/actions/actionProperties.tsx create mode 100644 client/excalidraw/actions/actionSelectAll.ts create mode 100644 client/excalidraw/actions/actionStyles.test.tsx create mode 100644 client/excalidraw/actions/actionStyles.ts create mode 100644 client/excalidraw/actions/actionToggleGridMode.tsx create mode 100644 client/excalidraw/actions/actionToggleLock.ts create mode 100644 client/excalidraw/actions/actionToggleStats.tsx create mode 100644 client/excalidraw/actions/actionToggleViewMode.tsx create mode 100644 client/excalidraw/actions/actionToggleZenMode.tsx create mode 100644 client/excalidraw/actions/actionZindex.tsx create mode 100644 client/excalidraw/actions/index.ts create mode 100644 client/excalidraw/actions/manager.tsx create mode 100644 client/excalidraw/actions/register.ts create mode 100644 client/excalidraw/actions/shortcuts.ts create mode 100644 client/excalidraw/actions/types.ts create mode 100644 client/excalidraw/align.ts create mode 100644 client/excalidraw/analytics.ts create mode 100644 client/excalidraw/appState.ts create mode 100644 client/excalidraw/bug-issue-template.js create mode 100644 client/excalidraw/charts.test.ts create mode 100644 client/excalidraw/charts.ts create mode 100644 client/excalidraw/clients.ts create mode 100644 client/excalidraw/clipboard.test.ts create mode 100644 client/excalidraw/clipboard.ts create mode 100644 client/excalidraw/colors.ts create mode 100644 client/excalidraw/components/Actions.scss create mode 100644 client/excalidraw/components/Actions.tsx create mode 100644 client/excalidraw/components/ActiveConfirmDialog.tsx create mode 100644 client/excalidraw/components/App.test.tsx create mode 100644 client/excalidraw/components/App.tsx create mode 100644 client/excalidraw/components/Avatar.scss create mode 100644 client/excalidraw/components/Avatar.tsx create mode 100644 client/excalidraw/components/BraveMeasureTextError.tsx create mode 100644 client/excalidraw/components/Button.scss create mode 100644 client/excalidraw/components/Button.tsx create mode 100644 client/excalidraw/components/ButtonIconCycle.tsx create mode 100644 client/excalidraw/components/ButtonIconSelect.tsx create mode 100644 client/excalidraw/components/ButtonSelect.tsx create mode 100644 client/excalidraw/components/Card.scss create mode 100644 client/excalidraw/components/Card.tsx create mode 100644 client/excalidraw/components/CheckboxItem.scss create mode 100644 client/excalidraw/components/CheckboxItem.tsx create mode 100644 client/excalidraw/components/ColorPicker.scss create mode 100644 client/excalidraw/components/ColorPicker.tsx create mode 100644 client/excalidraw/components/ConfirmDialog.scss create mode 100644 client/excalidraw/components/ConfirmDialog.tsx create mode 100644 client/excalidraw/components/ContextMenu.scss create mode 100644 client/excalidraw/components/ContextMenu.tsx create mode 100644 client/excalidraw/components/DarkModeToggle.tsx create mode 100644 client/excalidraw/components/Dialog.scss create mode 100644 client/excalidraw/components/Dialog.tsx create mode 100644 client/excalidraw/components/DialogActionButton.scss create mode 100644 client/excalidraw/components/DialogActionButton.tsx create mode 100644 client/excalidraw/components/ErrorDialog.tsx create mode 100644 client/excalidraw/components/ExportDialog.scss create mode 100644 client/excalidraw/components/FixedSideContainer.scss create mode 100644 client/excalidraw/components/FixedSideContainer.tsx create mode 100644 client/excalidraw/components/HandButton.tsx create mode 100644 client/excalidraw/components/HelpButton.tsx create mode 100644 client/excalidraw/components/HelpDialog.scss create mode 100644 client/excalidraw/components/HelpDialog.tsx create mode 100644 client/excalidraw/components/HintViewer.scss create mode 100644 client/excalidraw/components/HintViewer.tsx create mode 100644 client/excalidraw/components/IconPicker.scss create mode 100644 client/excalidraw/components/IconPicker.tsx create mode 100644 client/excalidraw/components/ImageExportDialog.tsx create mode 100644 client/excalidraw/components/InitializeApp.tsx create mode 100644 client/excalidraw/components/Island.scss create mode 100644 client/excalidraw/components/Island.tsx create mode 100644 client/excalidraw/components/JSONExportDialog.tsx create mode 100644 client/excalidraw/components/LayerUI.scss create mode 100644 client/excalidraw/components/LayerUI.tsx create mode 100644 client/excalidraw/components/LibraryButton.scss create mode 100644 client/excalidraw/components/LibraryButton.tsx create mode 100644 client/excalidraw/components/LibraryMenu.scss create mode 100644 client/excalidraw/components/LibraryMenu.tsx create mode 100644 client/excalidraw/components/LibraryMenuBrowseButton.tsx create mode 100644 client/excalidraw/components/LibraryMenuHeaderContent.tsx create mode 100644 client/excalidraw/components/LibraryMenuItems.scss create mode 100644 client/excalidraw/components/LibraryMenuItems.tsx create mode 100644 client/excalidraw/components/LibraryUnit.scss create mode 100644 client/excalidraw/components/LibraryUnit.tsx create mode 100644 client/excalidraw/components/LoadingMessage.tsx create mode 100644 client/excalidraw/components/LockButton.tsx create mode 100644 client/excalidraw/components/MobileMenu.tsx create mode 100644 client/excalidraw/components/Modal.scss create mode 100644 client/excalidraw/components/Modal.tsx create mode 100644 client/excalidraw/components/PasteChartDialog.scss create mode 100644 client/excalidraw/components/PasteChartDialog.tsx create mode 100644 client/excalidraw/components/PenModeButton.tsx create mode 100644 client/excalidraw/components/Popover.scss create mode 100644 client/excalidraw/components/Popover.tsx create mode 100644 client/excalidraw/components/ProjectName.scss create mode 100644 client/excalidraw/components/ProjectName.tsx create mode 100644 client/excalidraw/components/PublishLibrary.scss create mode 100644 client/excalidraw/components/PublishLibrary.tsx create mode 100644 client/excalidraw/components/Section.tsx create mode 100644 client/excalidraw/components/Sidebar/Sidebar.scss create mode 100644 client/excalidraw/components/Sidebar/Sidebar.test.tsx create mode 100644 client/excalidraw/components/Sidebar/Sidebar.tsx create mode 100644 client/excalidraw/components/Sidebar/SidebarHeader.tsx create mode 100644 client/excalidraw/components/Sidebar/common.ts create mode 100644 client/excalidraw/components/Spinner.scss create mode 100644 client/excalidraw/components/Spinner.tsx create mode 100644 client/excalidraw/components/Stack.scss create mode 100644 client/excalidraw/components/Stack.tsx create mode 100644 client/excalidraw/components/Stats.scss create mode 100644 client/excalidraw/components/Stats.tsx create mode 100644 client/excalidraw/components/TextInput.scss create mode 100644 client/excalidraw/components/Toast.scss create mode 100644 client/excalidraw/components/Toast.tsx create mode 100644 client/excalidraw/components/ToolButton.tsx create mode 100644 client/excalidraw/components/ToolIcon.scss create mode 100644 client/excalidraw/components/Toolbar.scss create mode 100644 client/excalidraw/components/Tooltip.scss create mode 100644 client/excalidraw/components/Tooltip.tsx create mode 100644 client/excalidraw/components/TopErrorBoundary.tsx create mode 100644 client/excalidraw/components/UserList.scss create mode 100644 client/excalidraw/components/UserList.tsx create mode 100644 client/excalidraw/components/__snapshots__/App.test.tsx.snap create mode 100644 client/excalidraw/components/context/tunnels.ts create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenu.scss create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenu.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuGroup.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuItem.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuItemContent.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuItemLink.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuSeparator.tsx create mode 100644 client/excalidraw/components/dropdownMenu/DropdownMenuTrigger.tsx create mode 100644 client/excalidraw/components/dropdownMenu/common.ts create mode 100644 client/excalidraw/components/dropdownMenu/dropdownMenuUtils.ts create mode 100644 client/excalidraw/components/footer/Footer.tsx create mode 100644 client/excalidraw/components/footer/FooterCenter.scss create mode 100644 client/excalidraw/components/footer/FooterCenter.tsx create mode 100644 client/excalidraw/components/hoc/withInternalFallback.tsx create mode 100644 client/excalidraw/components/hoc/withUpstreamOverride.tsx create mode 100644 client/excalidraw/components/icons.tsx create mode 100644 client/excalidraw/components/live-collaboration/LiveCollaborationTrigger.scss create mode 100644 client/excalidraw/components/live-collaboration/LiveCollaborationTrigger.tsx create mode 100644 client/excalidraw/components/main-menu/DefaultItems.scss create mode 100644 client/excalidraw/components/main-menu/DefaultItems.tsx create mode 100644 client/excalidraw/components/main-menu/MainMenu.tsx create mode 100644 client/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx create mode 100644 client/excalidraw/components/welcome-screen/WelcomeScreen.Hints.tsx create mode 100644 client/excalidraw/components/welcome-screen/WelcomeScreen.scss create mode 100644 client/excalidraw/components/welcome-screen/WelcomeScreen.tsx create mode 100644 client/excalidraw/constants.ts create mode 100644 client/excalidraw/css.d.ts create mode 100644 client/excalidraw/css/app.scss create mode 100644 client/excalidraw/css/styles.scss create mode 100644 client/excalidraw/css/theme.scss create mode 100644 client/excalidraw/css/variables.module.scss create mode 100644 client/excalidraw/data/blob.ts create mode 100644 client/excalidraw/data/encode.ts create mode 100644 client/excalidraw/data/encryption.ts create mode 100644 client/excalidraw/data/filesystem.ts create mode 100644 client/excalidraw/data/image.ts create mode 100644 client/excalidraw/data/index.ts create mode 100644 client/excalidraw/data/json.ts create mode 100644 client/excalidraw/data/library.ts create mode 100644 client/excalidraw/data/resave.ts create mode 100644 client/excalidraw/data/restore.ts create mode 100644 client/excalidraw/data/types.ts create mode 100644 client/excalidraw/distribute.ts create mode 100644 client/excalidraw/element/Hyperlink.scss create mode 100644 client/excalidraw/element/Hyperlink.tsx create mode 100644 client/excalidraw/element/binding.ts create mode 100644 client/excalidraw/element/bounds.test.ts create mode 100644 client/excalidraw/element/bounds.ts create mode 100644 client/excalidraw/element/collision.ts create mode 100644 client/excalidraw/element/dragElements.ts create mode 100644 client/excalidraw/element/image.ts create mode 100644 client/excalidraw/element/index.ts create mode 100644 client/excalidraw/element/linearElementEditor.ts create mode 100644 client/excalidraw/element/mutateElement.ts create mode 100644 client/excalidraw/element/newElement.test.ts create mode 100644 client/excalidraw/element/newElement.ts create mode 100644 client/excalidraw/element/resizeElements.ts create mode 100644 client/excalidraw/element/resizeTest.ts create mode 100644 client/excalidraw/element/showSelectedShapeActions.ts create mode 100644 client/excalidraw/element/sizeHelpers.test.ts create mode 100644 client/excalidraw/element/sizeHelpers.ts create mode 100644 client/excalidraw/element/sortElements.test.ts create mode 100644 client/excalidraw/element/sortElements.ts create mode 100644 client/excalidraw/element/textElement.test.ts create mode 100644 client/excalidraw/element/textElement.ts create mode 100644 client/excalidraw/element/textWysiwyg.test.tsx create mode 100644 client/excalidraw/element/textWysiwyg.tsx create mode 100644 client/excalidraw/element/transformHandles.ts create mode 100644 client/excalidraw/element/typeChecks.test.ts create mode 100644 client/excalidraw/element/typeChecks.ts create mode 100644 client/excalidraw/element/types.ts create mode 100644 client/excalidraw/errors.ts create mode 100644 client/excalidraw/excalidraw-app/CustomStats.tsx create mode 100644 client/excalidraw/excalidraw-app/app-jotai.ts create mode 100644 client/excalidraw/excalidraw-app/app_constants.ts create mode 100644 client/excalidraw/excalidraw-app/collab/Collab.tsx create mode 100644 client/excalidraw/excalidraw-app/collab/Portal.tsx create mode 100644 client/excalidraw/excalidraw-app/collab/RoomDialog.scss create mode 100644 client/excalidraw/excalidraw-app/collab/RoomDialog.tsx create mode 100644 client/excalidraw/excalidraw-app/collab/reconciliation.ts create mode 100644 client/excalidraw/excalidraw-app/components/AppFooter.tsx create mode 100644 client/excalidraw/excalidraw-app/components/AppMainMenu.tsx create mode 100644 client/excalidraw/excalidraw-app/components/AppWelcomeScreen.tsx create mode 100644 client/excalidraw/excalidraw-app/components/EncryptedIcon.tsx create mode 100644 client/excalidraw/excalidraw-app/components/ExcalidrawPlusAppLink.tsx create mode 100644 client/excalidraw/excalidraw-app/components/ExportToExcalidrawPlus.tsx create mode 100644 client/excalidraw/excalidraw-app/components/GitHubCorner.tsx create mode 100644 client/excalidraw/excalidraw-app/components/LanguageList.tsx create mode 100644 client/excalidraw/excalidraw-app/components/icons.tsx create mode 100644 client/excalidraw/excalidraw-app/data/FileManager.ts create mode 100644 client/excalidraw/excalidraw-app/data/LocalData.ts create mode 100644 client/excalidraw/excalidraw-app/data/Locker.ts create mode 100644 client/excalidraw/excalidraw-app/data/firebase.ts create mode 100644 client/excalidraw/excalidraw-app/data/index.ts create mode 100644 client/excalidraw/excalidraw-app/data/localStorage.ts create mode 100644 client/excalidraw/excalidraw-app/data/tabSync.ts create mode 100644 client/excalidraw/excalidraw-app/index.scss create mode 100644 client/excalidraw/excalidraw-app/index.tsx create mode 100644 client/excalidraw/excalidraw-app/pwa.ts create mode 100644 client/excalidraw/excalidraw-app/sentry.ts create mode 100644 client/excalidraw/ga.ts create mode 100644 client/excalidraw/gadirections.ts create mode 100644 client/excalidraw/galines.ts create mode 100644 client/excalidraw/gapoints.ts create mode 100644 client/excalidraw/gatransforms.ts create mode 100644 client/excalidraw/gesture.ts create mode 100644 client/excalidraw/global.d.ts create mode 100644 client/excalidraw/groups.ts create mode 100644 client/excalidraw/history.ts create mode 100644 client/excalidraw/hooks/useCallbackRefState.ts create mode 100644 client/excalidraw/hooks/useOutsideClick.ts create mode 100644 client/excalidraw/i18n.ts create mode 100644 client/excalidraw/index-node.ts create mode 100644 client/excalidraw/index.tsx create mode 100644 client/excalidraw/jotai.ts create mode 100644 client/excalidraw/keys.ts create mode 100644 client/excalidraw/locales/README.md create mode 100644 client/excalidraw/locales/ar-SA.json create mode 100644 client/excalidraw/locales/bg-BG.json create mode 100644 client/excalidraw/locales/bn-BD.json create mode 100644 client/excalidraw/locales/ca-ES.json create mode 100644 client/excalidraw/locales/cs-CZ.json create mode 100644 client/excalidraw/locales/da-DK.json create mode 100644 client/excalidraw/locales/de-DE.json create mode 100644 client/excalidraw/locales/el-GR.json create mode 100644 client/excalidraw/locales/en.json create mode 100644 client/excalidraw/locales/es-ES.json create mode 100644 client/excalidraw/locales/eu-ES.json create mode 100644 client/excalidraw/locales/fa-IR.json create mode 100644 client/excalidraw/locales/fi-FI.json create mode 100644 client/excalidraw/locales/fr-FR.json create mode 100644 client/excalidraw/locales/gl-ES.json create mode 100644 client/excalidraw/locales/he-IL.json create mode 100644 client/excalidraw/locales/hi-IN.json create mode 100644 client/excalidraw/locales/hu-HU.json create mode 100644 client/excalidraw/locales/id-ID.json create mode 100644 client/excalidraw/locales/it-IT.json create mode 100644 client/excalidraw/locales/ja-JP.json create mode 100644 client/excalidraw/locales/kab-KAB.json create mode 100644 client/excalidraw/locales/kk-KZ.json create mode 100644 client/excalidraw/locales/ko-KR.json create mode 100644 client/excalidraw/locales/ku-TR.json create mode 100644 client/excalidraw/locales/lt-LT.json create mode 100644 client/excalidraw/locales/lv-LV.json create mode 100644 client/excalidraw/locales/mr-IN.json create mode 100644 client/excalidraw/locales/my-MM.json create mode 100644 client/excalidraw/locales/nb-NO.json create mode 100644 client/excalidraw/locales/nl-NL.json create mode 100644 client/excalidraw/locales/nn-NO.json create mode 100644 client/excalidraw/locales/oc-FR.json create mode 100644 client/excalidraw/locales/pa-IN.json create mode 100644 client/excalidraw/locales/percentages.json create mode 100644 client/excalidraw/locales/pl-PL.json create mode 100644 client/excalidraw/locales/pt-BR.json create mode 100644 client/excalidraw/locales/pt-PT.json create mode 100644 client/excalidraw/locales/ro-RO.json create mode 100644 client/excalidraw/locales/ru-RU.json create mode 100644 client/excalidraw/locales/si-LK.json create mode 100644 client/excalidraw/locales/sk-SK.json create mode 100644 client/excalidraw/locales/sl-SI.json create mode 100644 client/excalidraw/locales/sv-SE.json create mode 100644 client/excalidraw/locales/ta-IN.json create mode 100644 client/excalidraw/locales/th-TH.json create mode 100644 client/excalidraw/locales/tr-TR.json create mode 100644 client/excalidraw/locales/uk-UA.json create mode 100644 client/excalidraw/locales/vi-VN.json create mode 100644 client/excalidraw/locales/zh-CN.json create mode 100644 client/excalidraw/locales/zh-HK.json create mode 100644 client/excalidraw/locales/zh-TW.json create mode 100644 client/excalidraw/math.test.ts create mode 100644 client/excalidraw/math.ts create mode 100644 client/excalidraw/packages/excalidraw/.gitignore create mode 100644 client/excalidraw/packages/excalidraw/CHANGELOG.md create mode 100644 client/excalidraw/packages/excalidraw/README.md create mode 100644 client/excalidraw/packages/excalidraw/entry.js create mode 100644 client/excalidraw/packages/excalidraw/env.js create mode 100644 client/excalidraw/packages/excalidraw/example/App.scss create mode 100644 client/excalidraw/packages/excalidraw/example/App.tsx create mode 100644 client/excalidraw/packages/excalidraw/example/CustomFooter.tsx create mode 100644 client/excalidraw/packages/excalidraw/example/MobileFooter.tsx create mode 100644 client/excalidraw/packages/excalidraw/example/index.tsx create mode 100644 client/excalidraw/packages/excalidraw/example/initialData.js create mode 100644 client/excalidraw/packages/excalidraw/example/public/images/doremon.png create mode 100644 client/excalidraw/packages/excalidraw/example/public/images/excalibot.png create mode 100644 client/excalidraw/packages/excalidraw/example/public/images/pika.jpeg create mode 100644 client/excalidraw/packages/excalidraw/example/public/images/rocket.jpeg create mode 100644 client/excalidraw/packages/excalidraw/example/public/index.html create mode 100644 client/excalidraw/packages/excalidraw/example/sidebar/ExampleSidebar.scss create mode 100644 client/excalidraw/packages/excalidraw/example/sidebar/ExampleSidebar.tsx create mode 100644 client/excalidraw/packages/excalidraw/index.tsx create mode 100644 client/excalidraw/packages/excalidraw/main.js create mode 100644 client/excalidraw/packages/excalidraw/package.json create mode 100644 client/excalidraw/packages/excalidraw/publicPath.js create mode 100644 client/excalidraw/packages/excalidraw/webpack.dev-server.config.js create mode 100644 client/excalidraw/packages/excalidraw/webpack.dev.config.js create mode 100644 client/excalidraw/packages/excalidraw/webpack.prod.config.js create mode 100644 client/excalidraw/packages/excalidraw/yarn.lock create mode 100644 client/excalidraw/packages/tsconfig.dev.json create mode 100644 client/excalidraw/packages/tsconfig.prod.json create mode 100644 client/excalidraw/packages/utils.ts create mode 100644 client/excalidraw/packages/utils/CHANGELOG.md create mode 100644 client/excalidraw/packages/utils/README.md create mode 100644 client/excalidraw/packages/utils/index.js create mode 100644 client/excalidraw/packages/utils/package.json create mode 100644 client/excalidraw/packages/utils/webpack.prod.config.js create mode 100644 client/excalidraw/packages/utils/yarn.lock create mode 100644 client/excalidraw/points.ts create mode 100644 client/excalidraw/polyfill.ts create mode 100644 client/excalidraw/pwacompat.d.ts create mode 100644 client/excalidraw/random.ts create mode 100644 client/excalidraw/react-app-env.d.ts create mode 100644 client/excalidraw/renderer/renderElement.ts create mode 100644 client/excalidraw/renderer/renderScene.ts create mode 100644 client/excalidraw/renderer/roundRect.ts create mode 100644 client/excalidraw/scene/Fonts.ts create mode 100644 client/excalidraw/scene/Scene.ts create mode 100644 client/excalidraw/scene/comparisons.ts create mode 100644 client/excalidraw/scene/export.ts create mode 100644 client/excalidraw/scene/index.ts create mode 100644 client/excalidraw/scene/scroll.ts create mode 100644 client/excalidraw/scene/scrollbars.ts create mode 100644 client/excalidraw/scene/selection.ts create mode 100644 client/excalidraw/scene/types.ts create mode 100644 client/excalidraw/scene/zoom.ts create mode 100644 client/excalidraw/service-worker.ts create mode 100644 client/excalidraw/serviceWorkerRegistration.ts create mode 100644 client/excalidraw/setupTests.ts create mode 100644 client/excalidraw/shapes.tsx create mode 100644 client/excalidraw/tests/MobileMenu.test.tsx create mode 100644 client/excalidraw/tests/__snapshots__/MobileMenu.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/charts.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/dragCreate.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/export.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/linearElementEditor.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/move.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/multiPointCreate.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap create mode 100644 client/excalidraw/tests/__snapshots__/selection.test.tsx.snap create mode 100644 client/excalidraw/tests/align.test.tsx create mode 100644 client/excalidraw/tests/appState.test.tsx create mode 100644 client/excalidraw/tests/binding.test.tsx create mode 100644 client/excalidraw/tests/charts.test.tsx create mode 100644 client/excalidraw/tests/clients.test.ts create mode 100644 client/excalidraw/tests/clipboard.test.tsx create mode 100644 client/excalidraw/tests/collab.test.tsx create mode 100644 client/excalidraw/tests/contextmenu.test.tsx create mode 100644 client/excalidraw/tests/data/__snapshots__/restore.test.ts.snap create mode 100644 client/excalidraw/tests/data/restore.test.ts create mode 100644 client/excalidraw/tests/dragCreate.test.tsx create mode 100644 client/excalidraw/tests/elementLocking.test.tsx create mode 100644 client/excalidraw/tests/export.test.tsx create mode 100644 client/excalidraw/tests/fitToContent.test.tsx create mode 100644 client/excalidraw/tests/fixtures/deer.png create mode 100644 client/excalidraw/tests/fixtures/diagramFixture.ts create mode 100644 client/excalidraw/tests/fixtures/elementFixture.ts create mode 100644 client/excalidraw/tests/fixtures/fixture_library.excalidrawlib create mode 100644 client/excalidraw/tests/fixtures/smiley.png create mode 100644 client/excalidraw/tests/fixtures/smiley_embedded_v2.png create mode 100644 client/excalidraw/tests/fixtures/smiley_embedded_v2.svg create mode 100644 client/excalidraw/tests/fixtures/svg-image-exporting-reference.svg create mode 100644 client/excalidraw/tests/fixtures/test_embedded_v1.png create mode 100644 client/excalidraw/tests/fixtures/test_embedded_v1.svg create mode 100644 client/excalidraw/tests/flip.test.tsx create mode 100644 client/excalidraw/tests/geometricAlgebra.test.ts create mode 100644 client/excalidraw/tests/helpers/api.ts create mode 100644 client/excalidraw/tests/helpers/ui.ts create mode 100644 client/excalidraw/tests/history.test.tsx create mode 100644 client/excalidraw/tests/library.test.tsx create mode 100644 client/excalidraw/tests/linearElementEditor.test.tsx create mode 100644 client/excalidraw/tests/move.test.tsx create mode 100644 client/excalidraw/tests/multiPointCreate.test.tsx create mode 100644 client/excalidraw/tests/packages/__snapshots__/excalidraw.test.tsx.snap create mode 100644 client/excalidraw/tests/packages/__snapshots__/utils.test.ts.snap create mode 100644 client/excalidraw/tests/packages/excalidraw.test.tsx create mode 100644 client/excalidraw/tests/packages/utils.test.ts create mode 100644 client/excalidraw/tests/packages/utils.unmocked.test.ts create mode 100644 client/excalidraw/tests/queries/toolQueries.ts create mode 100644 client/excalidraw/tests/reconciliation.test.ts create mode 100644 client/excalidraw/tests/regressionTests.test.tsx create mode 100644 client/excalidraw/tests/resize.test.tsx create mode 100644 client/excalidraw/tests/scene/__snapshots__/export.test.ts.snap create mode 100644 client/excalidraw/tests/scene/export.test.ts create mode 100644 client/excalidraw/tests/scroll.test.tsx create mode 100644 client/excalidraw/tests/selection.test.tsx create mode 100644 client/excalidraw/tests/shortcuts.test.tsx create mode 100644 client/excalidraw/tests/test-utils.ts create mode 100644 client/excalidraw/tests/utils.test.ts create mode 100644 client/excalidraw/tests/utils.ts create mode 100644 client/excalidraw/tests/viewMode.test.tsx create mode 100644 client/excalidraw/tests/zindex.test.tsx create mode 100644 client/excalidraw/types.ts create mode 100644 client/excalidraw/utility-types.ts create mode 100644 client/excalidraw/utils.ts create mode 100644 client/excalidraw/zindex.ts diff --git a/client/excalidraw/actions/actionAddToLibrary.ts b/client/excalidraw/actions/actionAddToLibrary.ts new file mode 100644 index 0000000000..a4fca560a2 --- /dev/null +++ b/client/excalidraw/actions/actionAddToLibrary.ts @@ -0,0 +1,60 @@ +import { register } from "./register"; +import { getSelectedElements } from "../scene"; +import { getNonDeletedElements } from "../element"; +import { deepCopyElement } from "../element/newElement"; +import { randomId } from "../random"; +import { t } from "../i18n"; + +export const actionAddToLibrary = register({ + name: "addToLibrary", + trackEvent: { category: "element" }, + perform: (elements, appState, _, app) => { + const selectedElements = getSelectedElements( + getNonDeletedElements(elements), + appState, + true, + ); + if (selectedElements.some((element) => element.type === "image")) { + return { + commitToHistory: false, + appState: { + ...appState, + errorMessage: "Support for adding images to the library coming soon!", + }, + }; + } + + return app.library + .getLatestLibrary() + .then((items) => { + return app.library.setLibrary([ + { + id: randomId(), + status: "unpublished", + elements: selectedElements.map(deepCopyElement), + created: Date.now(), + }, + ...items, + ]); + }) + .then(() => { + return { + commitToHistory: false, + appState: { + ...appState, + toast: { message: t("toast.addedToLibrary") }, + }, + }; + }) + .catch((error) => { + return { + commitToHistory: false, + appState: { + ...appState, + errorMessage: error.message, + }, + }; + }); + }, + contextItemLabel: "labels.addToLibrary", +}); diff --git a/client/excalidraw/actions/actionAlign.tsx b/client/excalidraw/actions/actionAlign.tsx new file mode 100644 index 0000000000..eceb421714 --- /dev/null +++ b/client/excalidraw/actions/actionAlign.tsx @@ -0,0 +1,216 @@ +import { alignElements, Alignment } from "../align"; +import { + AlignBottomIcon, + AlignLeftIcon, + AlignRightIcon, + AlignTopIcon, + CenterHorizontallyIcon, + CenterVerticallyIcon, +} from "../components/icons"; +import { ToolButton } from "../components/ToolButton"; +import { getNonDeletedElements } from "../element"; +import { ExcalidrawElement } from "../element/types"; +import { t } from "../i18n"; +import { KEYS } from "../keys"; +import { getSelectedElements, isSomeElementSelected } from "../scene"; +import { AppState } from "../types"; +import { arrayToMap, getShortcutKey } from "../utils"; +import { register } from "./register"; + +const enableActionGroup = ( + elements: readonly ExcalidrawElement[], + appState: AppState, +) => getSelectedElements(getNonDeletedElements(elements), appState).length > 1; + +const alignSelectedElements = ( + elements: readonly ExcalidrawElement[], + appState: Readonly, + alignment: Alignment, +) => { + const selectedElements = getSelectedElements( + getNonDeletedElements(elements), + appState, + ); + + const updatedElements = alignElements(selectedElements, alignment); + + const updatedElementsMap = arrayToMap(updatedElements); + + return elements.map( + (element) => updatedElementsMap.get(element.id) || element, + ); +}; + +export const actionAlignTop = register({ + name: "alignTop", + trackEvent: { category: "element" }, + perform: (elements, appState) => { + return { + appState, + elements: alignSelectedElements(elements, appState, { + position: "start", + axis: "y", + }), + commitToHistory: true, + }; + }, + keyTest: (event) => + event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_UP, + PanelComponent: ({ elements, appState, updateData }) => ( +