Virtual whiteboard for sketching hand-drawn like diagrams
feat: editor redesign 🔥 (#5780)
Barnabás Molnár6334bd832fc4
diff --git a/public/Assistant-Bold.woff2 b/public/Assistant-Bold.woff2new file mode 100644index 0000000000..751ba1ceb5Binary files /dev/null and b/public/Assistant-Bold.woff2 differdiff --git a/public/Assistant-Medium.woff2 b/public/Assistant-Medium.woff2new file mode 100644index 0000000000..d5d809abeeBinary files /dev/null and b/public/Assistant-Medium.woff2 differdiff --git a/public/Assistant-Regular.woff2 b/public/Assistant-Regular.woff2new file mode 100644index 0000000000..e17d6eccaaBinary files /dev/null and b/public/Assistant-Regular.woff2 differdiff --git a/public/Assistant-SemiBold.woff2 b/public/Assistant-SemiBold.woff2new file mode 100644index 0000000000..d17aa74bbaBinary files /dev/null and b/public/Assistant-SemiBold.woff2 differdiff --git a/public/fonts.css b/public/fonts.cssindex a27dd024cb..166afd8dd5 100644--- a/public/fonts.css+++ b/public/fonts.css@@ -11,3 +11,28 @@src: url("Cascadia.woff2");font-display: swap;}++@font-face {+ font-family: "Assistant";+ src: url("Assistant-Regular.woff2");+ font-display: swap;+ font-weight: 400;+}+@font-face {+ font-family: "Assistant";+ src: url("Assistant-Medium.woff2");+ font-display: swap;+ font-weight: 500;+}+@font-face {+ font-family: "Assistant";+ src: url("Assistant-SemiBold.woff2");+ font-display: swap;+ font-weight: 600;+}+@font-face {+ font-family: "Assistant";+ src: url("Assistant-Bold.woff2");+ font-display: swap;+ font-weight: 700;+}diff --git a/public/index.html b/public/index.htmlindex 4a4602b704..e065e6700c 100644--- a/public/index.html+++ b/public/index.html@@ -8,48 +8,56 @@content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover, shrink-to-fit=no"/><meta name="referrer" content="origin" />-<meta name="mobile-web-app-capable" content="yes" />+ <meta name="theme-color" content="#121212" />- <meta name="theme-color" content="#000" />-- <!-- General tags -->+ <!-- Primary Meta Tags -->+ <meta+ name="title"+ content="Excalidraw — Collaborative whiteboarding made easy"+ /><metaname="description"content="Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."/>- <meta name="image" content="og-image.png" />+ <meta name="image" content="https://excalidraw.com/og-general-v1.png" />- <!-- OpenGraph tags -->- <meta property="og:url" content="https://excalidraw.com" />+ <!-- Open Graph / Facebook --><meta property="og:site_name" content="Excalidraw" /><meta property="og:type" content="website" />- <meta property="og:title" content="Excalidraw" />+ <meta property="og:url" content="https://excalidraw.com" />+ <meta+ property="og:title"+ content="Excalidraw — Collaborative whiteboarding made easy"+ />+ <meta property="og:image:alt" content="Excalidraw logo" /><metaproperty="og:description"- content="Excalidraw is a whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."+ content="Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."+ />+ <meta property="og:image" content="https://excalidraw.com/og-fb-v1.png" />++ <!-- Twitter -->+ <meta property="twitter:card" content="summary_large_image" />+ <meta property="twitter:site" content="@excalidraw" />+ <meta property="twitter:url" content="https://excalidraw.com" />+ <meta+ property="twitter:title"+ content="Excalidraw — Collaborative whiteboarding made easy"/>- <!-- OG tags require an absolute url for images --><meta- property="og:image"- name="twitter:image"- content="https://excalidraw.com/og-image.png"+ property="twitter:description"+ content="Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."/><meta- property="og:image:secure_url"- name="twitter:image"- content="https://excalidraw.com/og-image.png"+ property="twitter:image"+ content="https://excalidraw.com/og-twitter-v1.png"/>- <meta property="og:image:width" content="1280" />- <meta property="og:image:height" content="669" />- <meta property="og:image:alt" content="Excalidraw logo with byline." />- <!-- Twitter Card tags -->- <meta name="twitter:card" content="summary_large_image" />- <meta name="twitter:title" content="Excalidraw" />+ <!-- General tags --><meta- name="twitter:description"- content="Excalidraw is a whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."+ name="description"+ content="Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them."/><!------------------------------------------------------------------------->@@ -158,8 +166,8 @@body,html {margin: 0;- --ui-font: system-ui, BlinkMacSystemFont, -apple-system, Segoe UI,- Roboto, Helvetica, Arial, sans-serif;+ --ui-font: Assistant, system-ui, BlinkMacSystemFont, -apple-system,+ Segoe UI, Roboto, Helvetica, Arial, sans-serif;font-family: var(--ui-font);-webkit-text-size-adjust: 100%;diff --git a/public/og-fb-v1.png b/public/og-fb-v1.pngnew file mode 100644index 0000000000..b626ee60a0Binary files /dev/null and b/public/og-fb-v1.png differdiff --git a/public/og-general-v1.png b/public/og-general-v1.pngnew file mode 100644index 0000000000..0a6fbb343cBinary files /dev/null and b/public/og-general-v1.png differdiff --git a/public/og-twitter-v1.png b/public/og-twitter-v1.pngnew file mode 100644index 0000000000..e7834c334bBinary files /dev/null and b/public/og-twitter-v1.png differdiff --git a/public/robots.txt b/public/robots.txtindex 75fc1a140c..1829690cdc 100644--- a/public/robots.txt+++ b/public/robots.txt@@ -1,3 +1,9 @@+User-agent: Twitterbot+Disallow:++User-agent: facebookexternalhit+Disallow:+user-agent: *Allow: /$Disallow: /diff --git a/src/actions/actionAlign.tsx b/src/actions/actionAlign.tsxindex 06e721fdc3..eceb421714 100644--- a/src/actions/actionAlign.tsx+++ b/src/actions/actionAlign.tsx@@ -60,7 +60,7 @@ export const actionAlignTop = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignTopIcon theme={appState.theme} />}+ icon={AlignTopIcon}onClick={() => updateData(null)}title={`${t("labels.alignTop")} — ${getShortcutKey("CtrlOrCmd+Shift+Up",@@ -90,7 +90,7 @@ export const actionAlignBottom = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignBottomIcon theme={appState.theme} />}+ icon={AlignBottomIcon}onClick={() => updateData(null)}title={`${t("labels.alignBottom")} — ${getShortcutKey("CtrlOrCmd+Shift+Down",@@ -120,7 +120,7 @@ export const actionAlignLeft = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignLeftIcon theme={appState.theme} />}+ icon={AlignLeftIcon}onClick={() => updateData(null)}title={`${t("labels.alignLeft")} — ${getShortcutKey("CtrlOrCmd+Shift+Left",@@ -151,7 +151,7 @@ export const actionAlignRight = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignRightIcon theme={appState.theme} />}+ icon={AlignRightIcon}onClick={() => updateData(null)}title={`${t("labels.alignRight")} — ${getShortcutKey("CtrlOrCmd+Shift+Right",@@ -180,7 +180,7 @@ export const actionAlignVerticallyCentered = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<CenterVerticallyIcon theme={appState.theme} />}+ icon={CenterVerticallyIcon}onClick={() => updateData(null)}title={t("labels.centerVertically")}aria-label={t("labels.centerVertically")}@@ -206,7 +206,7 @@ export const actionAlignHorizontallyCentered = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<CenterHorizontallyIcon theme={appState.theme} />}+ icon={CenterHorizontallyIcon}onClick={() => updateData(null)}title={t("labels.centerHorizontally")}aria-label={t("labels.centerHorizontally")}diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsxindex 3e1bd5f355..1572cbefed 100644--- a/src/actions/actionCanvas.tsx+++ b/src/actions/actionCanvas.tsx@@ -1,7 +1,12 @@import { ColorPicker } from "../components/ColorPicker";-import { eraser, zoomIn, zoomOut } from "../components/icons";+import {+ eraser,+ MoonIcon,+ SunIcon,+ ZoomInIcon,+ ZoomOutIcon,+} from "../components/icons";import { ToolButton } from "../components/ToolButton";-import { DarkModeToggle } from "../components/DarkModeToggle";import { MIN_ZOOM, THEME, ZOOM_STEP } from "../constants";import { getCommonBounds, getNonDeletedElements } from "../element";import { ExcalidrawElement } from "../element/types";@@ -18,6 +23,8 @@ import { newElementWith } from "../element/mutateElement";import { getDefaultAppState, isEraserActive } from "../appState";import ClearCanvas from "../components/ClearCanvas";import clsx from "clsx";+import MenuItem from "../components/MenuItem";+import { getShortcutFromShortcutName } from "./shortcuts";export const actionChangeViewBackgroundColor = register({name: "changeViewBackgroundColor",@@ -103,13 +110,13 @@ export const actionZoomIn = register({PanelComponent: ({ updateData }) => (<ToolButtontype="button"- icon={zoomIn}+ className="zoom-in-button zoom-button"+ icon={ZoomInIcon}title={`${t("buttons.zoomIn")} — ${getShortcutKey("CtrlOrCmd++")}`}aria-label={t("buttons.zoomIn")}onClick={() => {updateData(null);}}- size="small"/>),keyTest: (event) =>@@ -139,13 +146,13 @@ export const actionZoomOut = register({PanelComponent: ({ updateData }) => (<ToolButtontype="button"- icon={zoomOut}+ className="zoom-out-button zoom-button"+ icon={ZoomOutIcon}title={`${t("buttons.zoomOut")} — ${getShortcutKey("CtrlOrCmd+-")}`}aria-label={t("buttons.zoomOut")}onClick={() => {updateData(null);}}- size="small"/>),keyTest: (event) =>@@ -176,13 +183,12 @@ export const actionResetZoom = register({<Tooltip label={t("buttons.resetZoom")} style={{ height: "100%" }}><ToolButtontype="button"- className="reset-zoom-button"+ className="reset-zoom-button zoom-button"title={t("buttons.resetZoom")}aria-label={t("buttons.resetZoom")}onClick={() => {updateData(null);}}- size="small">{(appState.zoom.value * 100).toFixed(0)}%</ToolButton>@@ -288,14 +294,19 @@ export const actionToggleTheme = register({};},PanelComponent: ({ appState, updateData }) => (- <div style={{ marginInlineStart: "0.25rem" }}>- <DarkModeToggle- value={appState.theme}- onChange={(theme) => {- updateData(theme);- }}- />- </div>+ <MenuItem+ label={+ appState.theme === "dark"+ ? t("buttons.lightMode")+ : t("buttons.darkMode")+ }+ onClick={() => {+ updateData(appState.theme === THEME.LIGHT ? THEME.DARK : THEME.LIGHT);+ }}+ icon={appState.theme === "dark" ? SunIcon : MoonIcon}+ dataTestId="toggle-dark-mode"+ shortcut={getShortcutFromShortcutName("toggleTheme")}+ />),keyTest: (event) => event.altKey && event.shiftKey && event.code === CODES.D,});diff --git a/src/actions/actionDeleteSelected.tsx b/src/actions/actionDeleteSelected.tsxindex 0bbf6cb694..dfba34df79 100644--- a/src/actions/actionDeleteSelected.tsx+++ b/src/actions/actionDeleteSelected.tsx@@ -1,7 +1,6 @@import { isSomeElementSelected } from "../scene";import { KEYS } from "../keys";import { ToolButton } from "../components/ToolButton";-import { trash } from "../components/icons";import { t } from "../i18n";import { register } from "./register";import { getNonDeletedElements } from "../element";@@ -13,6 +12,7 @@ import { LinearElementEditor } from "../element/linearElementEditor";import { fixBindingsAfterDeletion } from "../element/binding";import { isBoundToContainer } from "../element/typeChecks";import { updateActiveTool } from "../utils";+import { TrashIcon } from "../components/icons";const deleteSelectedElements = (elements: readonly ExcalidrawElement[],@@ -149,7 +149,7 @@ export const actionDeleteSelected = register({PanelComponent: ({ elements, appState, updateData }) => (<ToolButtontype="button"- icon={trash}+ icon={TrashIcon}title={t("labels.delete")}aria-label={t("labels.delete")}onClick={() => updateData(null)}diff --git a/src/actions/actionDistribute.tsx b/src/actions/actionDistribute.tsxindex da5095a51d..9eaab70d3f 100644--- a/src/actions/actionDistribute.tsx+++ b/src/actions/actionDistribute.tsx@@ -56,7 +56,7 @@ export const distributeHorizontally = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<DistributeHorizontallyIcon theme={appState.theme} />}+ icon={DistributeHorizontallyIcon}onClick={() => updateData(null)}title={`${t("labels.distributeHorizontally")} — ${getShortcutKey("Alt+H",@@ -86,7 +86,7 @@ export const distributeVertically = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<DistributeVerticallyIcon theme={appState.theme} />}+ icon={DistributeVerticallyIcon}onClick={() => updateData(null)}title={`${t("labels.distributeVertically")} — ${getShortcutKey("Alt+V")}`}aria-label={t("labels.distributeVertically")}diff --git a/src/actions/actionDuplicateSelection.tsx b/src/actions/actionDuplicateSelection.tsxindex d8702a76da..fcff03f511 100644--- a/src/actions/actionDuplicateSelection.tsx+++ b/src/actions/actionDuplicateSelection.tsx@@ -4,7 +4,6 @@ import { ExcalidrawElement } from "../element/types";import { duplicateElement, getNonDeletedElements } from "../element";import { getSelectedElements, isSomeElementSelected } from "../scene";import { ToolButton } from "../components/ToolButton";-import { clone } from "../components/icons";import { t } from "../i18n";import { arrayToMap, getShortcutKey } from "../utils";import { LinearElementEditor } from "../element/linearElementEditor";@@ -19,6 +18,7 @@ import { ActionResult } from "./types";import { GRID_SIZE } from "../constants";import { bindTextToShapeAfterDuplication } from "../element/textElement";import { isBoundToContainer } from "../element/typeChecks";+import { DuplicateIcon } from "../components/icons";export const actionDuplicateSelection = register({name: "duplicateSelection",@@ -49,7 +49,7 @@ export const actionDuplicateSelection = register({PanelComponent: ({ elements, appState, updateData }) => (<ToolButtontype="button"- icon={clone}+ icon={DuplicateIcon}title={`${t("labels.duplicateSelection")} — ${getShortcutKey("CtrlOrCmd+D",)}`}diff --git a/src/actions/actionExport.tsx b/src/actions/actionExport.tsxindex a566e5bf91..2c2bec08ca 100644--- a/src/actions/actionExport.tsx+++ b/src/actions/actionExport.tsx@@ -1,4 +1,4 @@-import { load, questionCircle, saveAs } from "../components/icons";+import { LoadIcon, questionCircle, saveAs } from "../components/icons";import { ProjectName } from "../components/ProjectName";import { ToolButton } from "../components/ToolButton";import "../components/ToolIcon.scss";@@ -19,6 +19,8 @@ import { ActiveFile } from "../components/ActiveFile";import { isImageFileHandle } from "../data/blob";import { nativeFileSystemSupported } from "../data/filesystem";import { Theme } from "../element/types";+import MenuItem from "../components/MenuItem";+import { getShortcutFromShortcutName } from "./shortcuts";export const actionChangeProjectName = register({name: "changeProjectName",@@ -245,14 +247,12 @@ export const actionLoadScene = register({},keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.O,PanelComponent: ({ updateData }) => (- <ToolButton- type="button"- icon={load}- title={t("buttons.load")}- aria-label={t("buttons.load")}- showAriaLabel={useDevice().isMobile}+ <MenuItem+ label={t("buttons.load")}+ icon={LoadIcon}onClick={updateData}- data-testid="load-button"+ dataTestId="load-button"+ shortcut={getShortcutFromShortcutName("loadScene")}/>),});diff --git a/src/actions/actionHistory.tsx b/src/actions/actionHistory.tsxindex f8b1293b32..76aa9d7872 100644--- a/src/actions/actionHistory.tsx+++ b/src/actions/actionHistory.tsx@@ -1,5 +1,5 @@import { Action, ActionResult } from "./types";-import { undo, redo } from "../components/icons";+import { UndoIcon, RedoIcon } from "../components/icons";import { ToolButton } from "../components/ToolButton";import { t } from "../i18n";import History, { HistoryEntry } from "../history";@@ -72,7 +72,7 @@ export const createUndoAction: ActionCreator = (history) => ({PanelComponent: ({ updateData, data }) => (<ToolButtontype="button"- icon={undo}+ icon={UndoIcon}aria-label={t("buttons.undo")}onClick={updateData}size={data?.size || "medium"}@@ -94,7 +94,7 @@ export const createRedoAction: ActionCreator = (history) => ({PanelComponent: ({ updateData, data }) => (<ToolButtontype="button"- icon={redo}+ icon={RedoIcon}aria-label={t("buttons.redo")}onClick={updateData}size={data?.size || "medium"}diff --git a/src/actions/actionMenu.tsx b/src/actions/actionMenu.tsxindex f2ad33f9c5..3ba11a5a72 100644--- a/src/actions/actionMenu.tsx+++ b/src/actions/actionMenu.tsx@@ -1,11 +1,12 @@-import { menu, palette } from "../components/icons";+import { HamburgerMenuIcon, HelpIcon, palette } from "../components/icons";import { ToolButton } from "../components/ToolButton";import { t } from "../i18n";import { showSelectedShapeActions, getNonDeletedElements } from "../element";import { register } from "./register";import { allowFullScreen, exitFullScreen, isFullScreen } from "../utils";import { KEYS } from "../keys";-import { HelpIcon } from "../components/HelpIcon";+import { HelpButton } from "../components/HelpButton";+import MenuItem from "../components/MenuItem";export const actionToggleCanvasMenu = register({name: "toggleCanvasMenu",@@ -20,7 +21,7 @@ export const actionToggleCanvasMenu = register({PanelComponent: ({ appState, updateData }) => (<ToolButtontype="button"- icon={menu}+ icon={HamburgerMenuIcon}aria-label={t("buttons.menu")}onClick={updateData}selected={appState.openMenu === "canvas"}@@ -74,19 +75,28 @@ export const actionShortcuts = register({name: "toggleShortcuts",trackEvent: { category: "menu", action: "toggleHelpDialog" },perform: (_elements, appState, _, { focusContainer }) => {- if (appState.showHelpDialog) {+ if (appState.openDialog === "help") {focusContainer();}return {appState: {...appState,- showHelpDialog: !appState.showHelpDialog,+ openDialog: appState.openDialog === "help" ? null : "help",},commitToHistory: false,};},- PanelComponent: ({ updateData }) => (- <HelpIcon title={t("helpDialog.title")} onClick={updateData} />- ),+ PanelComponent: ({ updateData, isInHamburgerMenu }) =>+ isInHamburgerMenu ? (+ <MenuItem+ label={t("helpDialog.title")}+ dataTestId="help-menu-item"+ icon={HelpIcon}+ onClick={updateData}+ shortcut="?"+ />+ ) : (+ <HelpButton title={t("helpDialog.title")} onClick={updateData} />+ ),keyTest: (event) => event.key === KEYS.QUESTION_MARK,});diff --git a/src/actions/actionProperties.tsx b/src/actions/actionProperties.tsxindex ff407255d5..e75e86959b 100644--- a/src/actions/actionProperties.tsx+++ b/src/actions/actionProperties.tsx@@ -2,37 +2,41 @@ import { AppState } from "../../src/types";import { ButtonIconSelect } from "../components/ButtonIconSelect";import { ColorPicker } from "../components/ColorPicker";import { IconPicker } from "../components/IconPicker";+// TODO barnabasmolnar/editor-redesign+// TextAlignTopIcon, TextAlignBottomIcon,TextAlignMiddleIcon,+// ArrowHead iconsimport {ArrowheadArrowIcon,ArrowheadBarIcon,ArrowheadDotIcon,ArrowheadTriangleIcon,ArrowheadNoneIcon,- EdgeRoundIcon,- EdgeSharpIcon,- FillCrossHatchIcon,+ StrokeStyleDashedIcon,+ StrokeStyleDottedIcon,+ TextAlignTopIcon,+ TextAlignBottomIcon,+ TextAlignMiddleIcon,FillHachureIcon,+ FillCrossHatchIcon,FillSolidIcon,- FontFamilyCodeIcon,- FontFamilyHandDrawnIcon,- FontFamilyNormalIcon,- FontSizeExtraLargeIcon,- FontSizeLargeIcon,- FontSizeMediumIcon,- FontSizeSmallIcon,SloppinessArchitectIcon,SloppinessArtistIcon,SloppinessCartoonistIcon,- StrokeStyleDashedIcon,- StrokeStyleDottedIcon,- StrokeStyleSolidIcon,- StrokeWidthIcon,- TextAlignCenterIcon,+ StrokeWidthBaseIcon,+ StrokeWidthBoldIcon,+ StrokeWidthExtraBoldIcon,+ FontSizeSmallIcon,+ FontSizeMediumIcon,+ FontSizeLargeIcon,+ FontSizeExtraLargeIcon,+ EdgeSharpIcon,+ EdgeRoundIcon,+ FreedrawIcon,+ FontFamilyNormalIcon,+ FontFamilyCodeIcon,TextAlignLeftIcon,+ TextAlignCenterIcon,TextAlignRightIcon,- TextAlignTopIcon,- TextAlignBottomIcon,- TextAlignMiddleIcon,} from "../components/icons";import {DEFAULT_FONT_FAMILY,@@ -307,17 +311,17 @@ export const actionChangeFillStyle = register({{value: "hachure",text: t("labels.hachure"),- icon: <FillHachureIcon theme={appState.theme} />,+ icon: FillHachureIcon,},{value: "cross-hatch",text: t("labels.crossHatch"),- icon: <FillCrossHatchIcon theme={appState.theme} />,+ icon: FillCrossHatchIcon,},{value: "solid",text: t("labels.solid"),- icon: <FillSolidIcon theme={appState.theme} />,+ icon: FillSolidIcon,},]}group="fill"@@ -358,17 +362,17 @@ export const actionChangeStrokeWidth = register({{value: 1,text: t("labels.thin"),- icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={2} />,+ icon: StrokeWidthBaseIcon,},{value: 2,text: t("labels.bold"),- icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={6} />,+ icon: StrokeWidthBoldIcon,},{value: 4,text: t("labels.extraBold"),- icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={10} />,+ icon: StrokeWidthExtraBoldIcon,},]}value={getFormValue(@@ -407,17 +411,17 @@ export const actionChangeSloppiness = register({{value: 0,text: t("labels.architect"),- icon: <SloppinessArchitectIcon theme={appState.theme} />,+ icon: SloppinessArchitectIcon,},{value: 1,text: t("labels.artist"),- icon: <SloppinessArtistIcon theme={appState.theme} />,+ icon: SloppinessArtistIcon,},{value: 2,text: t("labels.cartoonist"),- icon: <SloppinessCartoonistIcon theme={appState.theme} />,+ icon: SloppinessCartoonistIcon,},]}value={getFormValue(@@ -455,17 +459,17 @@ export const actionChangeStrokeStyle = register({{value: "solid",text: t("labels.strokeStyle_solid"),- icon: <StrokeStyleSolidIcon theme={appState.theme} />,+ icon: StrokeWidthBaseIcon,},{value: "dashed",text: t("labels.strokeStyle_dashed"),- icon: <StrokeStyleDashedIcon theme={appState.theme} />,+ icon: StrokeStyleDashedIcon,},{value: "dotted",text: t("labels.strokeStyle_dotted"),- icon: <StrokeStyleDottedIcon theme={appState.theme} />,+ icon: StrokeStyleDottedIcon,},]}value={getFormValue(@@ -535,25 +539,25 @@ export const actionChangeFontSize = register({{value: 16,text: t("labels.small"),- icon: <FontSizeSmallIcon theme={appState.theme} />,+ icon: FontSizeSmallIcon,testId: "fontSize-small",},{value: 20,text: t("labels.medium"),- icon: <FontSizeMediumIcon theme={appState.theme} />,+ icon: FontSizeMediumIcon,testId: "fontSize-medium",},{value: 28,text: t("labels.large"),- icon: <FontSizeLargeIcon theme={appState.theme} />,+ icon: FontSizeLargeIcon,testId: "fontSize-large",},{value: 36,text: t("labels.veryLarge"),- icon: <FontSizeExtraLargeIcon theme={appState.theme} />,+ icon: FontSizeExtraLargeIcon,testId: "fontSize-veryLarge",},]}@@ -658,17 +662,17 @@ export const actionChangeFontFamily = register({{value: FONT_FAMILY.Virgil,text: t("labels.handDrawn"),- icon: <FontFamilyHandDrawnIcon theme={appState.theme} />,+ icon: FreedrawIcon,},{value: FONT_FAMILY.Helvetica,text: t("labels.normal"),- icon: <FontFamilyNormalIcon theme={appState.theme} />,+ icon: FontFamilyNormalIcon,},{value: FONT_FAMILY.Cascadia,text: t("labels.code"),- icon: <FontFamilyCodeIcon theme={appState.theme} />,+ icon: FontFamilyCodeIcon,},];@@ -739,17 +743,17 @@ export const actionChangeTextAlign = register({{value: "left",text: t("labels.left"),- icon: <TextAlignLeftIcon theme={appState.theme} />,+ icon: TextAlignLeftIcon,},{value: "center",text: t("labels.center"),- icon: <TextAlignCenterIcon theme={appState.theme} />,+ icon: TextAlignCenterIcon,},{value: "right",text: t("labels.right"),- icon: <TextAlignRightIcon theme={appState.theme} />,+ icon: TextAlignRightIcon,},]}value={getFormValue(@@ -882,12 +886,12 @@ export const actionChangeSharpness = register({{value: "sharp",text: t("labels.sharp"),- icon: <EdgeSharpIcon theme={appState.theme} />,+ icon: EdgeSharpIcon,},{value: "round",text: t("labels.round"),- icon: <EdgeRoundIcon theme={appState.theme} />,+ icon: EdgeRoundIcon,},]}value={getFormValue(@@ -949,42 +953,38 @@ export const actionChangeArrowhead = register({return (<fieldset><legend>{t("labels.arrowheads")}</legend>- <div className="iconSelectList">+ <div className="iconSelectList buttonList"><IconPickerlabel="arrowhead_start"options={[{value: null,text: t("labels.arrowhead_none"),- icon: <ArrowheadNoneIcon theme={appState.theme} />,+ icon: ArrowheadNoneIcon,keyBinding: "q",},{value: "arrow",text: t("labels.arrowhead_arrow"),- icon: (- <ArrowheadArrowIcon theme={appState.theme} flip={!isRTL} />- ),+ icon: <ArrowheadArrowIcon flip={!isRTL} />,keyBinding: "w",},{value: "bar",text: t("labels.arrowhead_bar"),- icon: <ArrowheadBarIcon theme={appState.theme} flip={!isRTL} />,+ icon: <ArrowheadBarIcon flip={!isRTL} />,keyBinding: "e",},{value: "dot",text: t("labels.arrowhead_dot"),- icon: <ArrowheadDotIcon theme={appState.theme} flip={!isRTL} />,+ icon: <ArrowheadDotIcon flip={!isRTL} />,keyBinding: "r",},{value: "triangle",text: t("labels.arrowhead_triangle"),- icon: (- <ArrowheadTriangleIcon theme={appState.theme} flip={!isRTL} />- ),+ icon: <ArrowheadTriangleIcon flip={!isRTL} />,keyBinding: "t",},]}@@ -1007,34 +1007,30 @@ export const actionChangeArrowhead = register({value: null,text: t("labels.arrowhead_none"),keyBinding: "q",- icon: <ArrowheadNoneIcon theme={appState.theme} />,+ icon: ArrowheadNoneIcon,},{value: "arrow",text: t("labels.arrowhead_arrow"),keyBinding: "w",- icon: (- <ArrowheadArrowIcon theme={appState.theme} flip={isRTL} />- ),+ icon: <ArrowheadArrowIcon flip={isRTL} />,},{value: "bar",text: t("labels.arrowhead_bar"),keyBinding: "e",- icon: <ArrowheadBarIcon theme={appState.theme} flip={isRTL} />,+ icon: <ArrowheadBarIcon flip={isRTL} />,},{value: "dot",text: t("labels.arrowhead_dot"),keyBinding: "r",- icon: <ArrowheadDotIcon theme={appState.theme} flip={isRTL} />,+ icon: <ArrowheadDotIcon flip={isRTL} />,},{value: "triangle",text: t("labels.arrowhead_triangle"),- icon: (- <ArrowheadTriangleIcon theme={appState.theme} flip={isRTL} />- ),+ icon: <ArrowheadTriangleIcon flip={isRTL} />,keyBinding: "t",},]}diff --git a/src/actions/actionZindex.tsx b/src/actions/actionZindex.tsxindex 629b386430..07da262176 100644--- a/src/actions/actionZindex.tsx+++ b/src/actions/actionZindex.tsx@@ -10,10 +10,10 @@ import { t } from "../i18n";import { getShortcutKey } from "../utils";import { register } from "./register";import {- SendBackwardIcon,+ BringForwardIcon,BringToFrontIcon,+ SendBackwardIcon,SendToBackIcon,- BringForwardIcon,} from "../components/icons";export const actionSendBackward = register({@@ -39,7 +39,7 @@ export const actionSendBackward = register({onClick={() => updateData(null)}title={`${t("labels.sendBackward")} — ${getShortcutKey("CtrlOrCmd+[")}`}>- <SendBackwardIcon theme={appState.theme} />+ {SendBackwardIcon}</button>),});@@ -67,7 +67,7 @@ export const actionBringForward = register({onClick={() => updateData(null)}title={`${t("labels.bringForward")} — ${getShortcutKey("CtrlOrCmd+]")}`}>- <BringForwardIcon theme={appState.theme} />+ {BringForwardIcon}</button>),});@@ -102,7 +102,7 @@ export const actionSendToBack = register({: getShortcutKey("CtrlOrCmd+Shift+[")}`}>- <SendToBackIcon theme={appState.theme} />+ {SendToBackIcon}</button>),});@@ -138,7 +138,7 @@ export const actionBringToFront = register({: getShortcutKey("CtrlOrCmd+Shift+]")}`}>- <BringToFrontIcon theme={appState.theme} />+ {BringToFrontIcon}</button>),});diff --git a/src/actions/manager.tsx b/src/actions/manager.tsxindex e2655e5068..c003422f2b 100644--- a/src/actions/manager.tsx+++ b/src/actions/manager.tsx@@ -135,8 +135,13 @@ export class ActionManager {/*** @param data additional data sent to the PanelComponent*/- renderAction = (name: ActionName, data?: PanelComponentProps["data"]) => {+ renderAction = (+ name: ActionName,+ data?: PanelComponentProps["data"],+ isInHamburgerMenu = false,+ ) => {const canvasActions = this.app.props.UIOptions.canvasActions;+if (this.actions[name] &&"PanelComponent" in this.actions[name] &&@@ -169,6 +174,7 @@ export class ActionManager {updateData={updateData}appProps={this.app.props}data={data}+ isInHamburgerMenu={isInHamburgerMenu}/>);}diff --git a/src/actions/shortcuts.ts b/src/actions/shortcuts.tsindex 2d37f20c21..4d53f47afa 100644--- a/src/actions/shortcuts.ts+++ b/src/actions/shortcuts.ts@@ -3,36 +3,45 @@ import { isDarwin } from "../keys";import { getShortcutKey } from "../utils";import { ActionName } from "./types";-export type ShortcutName = SubtypeOf<- ActionName,- | "cut"- | "copy"- | "paste"- | "copyStyles"- | "pasteStyles"- | "selectAll"- | "deleteSelectedElements"- | "duplicateSelection"- | "sendBackward"- | "bringForward"- | "sendToBack"- | "bringToFront"- | "copyAsPng"- | "copyAsSvg"- | "group"- | "ungroup"- | "gridMode"- | "zenMode"- | "stats"- | "addToLibrary"- | "viewMode"- | "flipHorizontal"- | "flipVertical"- | "hyperlink"- | "toggleLock"->;+export type ShortcutName =+ | SubtypeOf<+ ActionName,+ | "toggleTheme"+ | "loadScene"+ | "cut"+ | "copy"+ | "paste"+ | "copyStyles"+ | "pasteStyles"+ | "selectAll"+ | "deleteSelectedElements"+ | "duplicateSelection"+ | "sendBackward"+ | "bringForward"+ | "sendToBack"+ | "bringToFront"+ | "copyAsPng"+ | "copyAsSvg"+ | "group"+ | "ungroup"+ | "gridMode"+ | "zenMode"+ | "stats"+ | "addToLibrary"+ | "viewMode"+ | "flipHorizontal"+ | "flipVertical"+ | "hyperlink"+ | "toggleLock"+ >+ | "saveScene"+ | "imageExport";const shortcutMap: Record<ShortcutName, string[]> = {+ toggleTheme: [getShortcutKey("Shit+Alt+D")],+ saveScene: [getShortcutKey("CtrlOrCmd+S")],+ loadScene: [getShortcutKey("CtrlOrCmd+O")],+ imageExport: [getShortcutKey("CtrlOrCmd+Shift+E")],cut: [getShortcutKey("CtrlOrCmd+X")],copy: [getShortcutKey("CtrlOrCmd+C")],paste: [getShortcutKey("CtrlOrCmd+V")],diff --git a/src/actions/types.ts b/src/actions/types.tsindex ecde6540dd..b04cbef78c 100644--- a/src/actions/types.ts+++ b/src/actions/types.ts@@ -124,7 +124,9 @@ export type PanelComponentProps = {export interface Action {name: ActionName;- PanelComponent?: React.FC<PanelComponentProps>;+ PanelComponent?: React.FC<+ PanelComponentProps & { isInHamburgerMenu: boolean }+ >;perform: ActionFn;keyPriority?: number;keyTest?: (diff --git a/src/appState.ts b/src/appState.tsindex ab50118619..b35cd2a2e9 100644--- a/src/appState.ts+++ b/src/appState.ts@@ -19,6 +19,7 @@ export const getDefaultAppState = (): Omit<"offsetTop" | "offsetLeft" | "width" | "height"> => {return {+ showWelcomeScreen: false,theme: THEME.LIGHT,collaborators: new Map(),currentChartType: "bar",@@ -67,6 +68,7 @@ export const getDefaultAppState = (): Omit<openMenu: null,openPopup: null,openSidebar: null,+ openDialog: null,pasteDialog: { shown: false, data: null },previousSelectedElementIds: {},resizingElement: null,@@ -77,7 +79,6 @@ export const getDefaultAppState = (): Omit<selectedGroupIds: {},selectionElement: null,shouldCacheIgnoreZoom: false,- showHelpDialog: false,showStats: false,startBoundElement: null,suggestedBindings: [],@@ -110,6 +111,7 @@ const APP_STATE_STORAGE_CONF = (<T extends Record<keyof AppState, Values>,>(config: { [K in keyof T]: K extends keyof AppState ? T[K] : never }) =>config)({+ showWelcomeScreen: { browser: true, export: false, server: false },theme: { browser: true, export: false, server: false },collaborators: { browser: false, export: false, server: false },currentChartType: { browser: true, export: false, server: false },@@ -160,6 +162,7 @@ const APP_STATE_STORAGE_CONF = (<openMenu: { browser: true, export: false, server: false },openPopup: { browser: false, export: false, server: false },openSidebar: { browser: true, export: false, server: false },+ openDialog: { browser: false, export: false, server: false },pasteDialog: { browser: false, export: false, server: false },previousSelectedElementIds: { browser: true, export: false, server: false },resizingElement: { browser: false, export: false, server: false },@@ -170,7 +173,6 @@ const APP_STATE_STORAGE_CONF = (<selectedGroupIds: { browser: true, export: false, server: false },selectionElement: { browser: false, export: false, server: false },shouldCacheIgnoreZoom: { browser: true, export: false, server: false },- showHelpDialog: { browser: false, export: false, server: false },showStats: { browser: true, export: false, server: false },startBoundElement: { browser: false, export: false, server: false },suggestedBindings: { browser: false, export: false, server: false },diff --git a/src/clients.ts b/src/clients.tsindex 147902f448..e31b73eb92 100644--- a/src/clients.ts+++ b/src/clients.ts@@ -11,27 +11,18 @@ export const getClientColors = (clientId: string, appState: AppState) => {// Naive way of getting an integer out of the clientIdconst sum = clientId.split("").reduce((a, str) => a + str.charCodeAt(0), 0);- // Skip transparent background.- const backgrounds = colors.elementBackground.slice(1);- const strokes = colors.elementStroke.slice(1);+ // Skip transparent & gray colors+ const backgrounds = colors.elementBackground.slice(3);+ const strokes = colors.elementStroke.slice(3);return {background: backgrounds[sum % backgrounds.length],stroke: strokes[sum % strokes.length],};};-export const getClientInitials = (username?: string | null) => {- if (!username) {+export const getClientInitials = (userName?: string | null) => {+ if (!userName) {return "?";}- const names = username.trim().split(" ");-- if (names.length < 2) {- return names[0].substring(0, 2).toUpperCase();- }-- const firstName = names[0];- const lastName = names[names.length - 1];-- return (firstName[0] + lastName[0]).toUpperCase();+ return userName.trim()[0].toUpperCase();};diff --git a/src/components/Actions.scss b/src/components/Actions.scssnew file mode 100644index 0000000000..925e918d28--- /dev/null+++ b/src/components/Actions.scss@@ -0,0 +1,92 @@+.zoom-actions,+.undo-redo-buttons {+ background-color: var(--island-bg-color);+ border-radius: var(--border-radius-lg);+}++.zoom-button,+.undo-redo-buttons button {+ border: 1px solid var(--default-border-color) !important;+ border-radius: 0 !important;+ background-color: transparent !important;+ font-size: 0.875rem !important;+ width: var(--lg-button-size);+ height: var(--lg-button-size);+ svg {+ width: var(--lg-icon-size) !important;+ height: var(--lg-icon-size) !important;+ }++ .ToolIcon__icon {+ width: 100%;+ height: 100%;+ }+}++.reset-zoom-button {+ border-left: 0 !important;+ border-right: 0 !important;+ padding: 0 0.625rem !important;+ width: 3.75rem !important;+ justify-content: center;+ color: var(--text-primary-color);+}++.zoom-out-button {+ border-top-left-radius: var(--border-radius-lg) !important;+ border-bottom-left-radius: var(--border-radius-lg) !important;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }++ .ToolIcon__icon {+ border-top-right-radius: 0 !important;+ border-bottom-right-radius: 0 !important;+ }+}++.zoom-in-button {+ border-top-right-radius: var(--border-radius-lg) !important;+ border-bottom-right-radius: var(--border-radius-lg) !important;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }++ .ToolIcon__icon {+ border-top-left-radius: 0 !important;+ border-bottom-left-radius: 0 !important;+ }+}++.undo-redo-buttons {+ .undo-button-container button {+ border-top-left-radius: var(--border-radius-lg) !important;+ border-bottom-left-radius: var(--border-radius-lg) !important;+ border-right: 0 !important;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }++ .ToolIcon__icon {+ border-top-right-radius: 0 !important;+ border-bottom-right-radius: 0 !important;+ }+ }++ .redo-button-container button {+ border-top-right-radius: var(--border-radius-lg) !important;+ border-bottom-right-radius: var(--border-radius-lg) !important;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }++ .ToolIcon__icon {+ border-top-left-radius: 0 !important;+ border-bottom-left-radius: 0 !important;+ }+ }+}diff --git a/src/components/Actions.tsx b/src/components/Actions.tsxindex 1ba40ba08f..2da4a151d9 100644--- a/src/components/Actions.tsx+++ b/src/components/Actions.tsx@@ -28,6 +28,8 @@ import { trackEvent } from "../analytics";import { hasBoundTextElement, isBoundToContainer } from "../element/typeChecks";import clsx from "clsx";import { actionToggleZenMode } from "../actions";+import "./Actions.scss";+import { Tooltip } from "./Tooltip";export const SelectedShapeActions = ({appState,@@ -79,12 +81,16 @@ export const SelectedShapeActions = ({return (<div className="panelColumn">- {((hasStrokeColor(appState.activeTool.type) &&- appState.activeTool.type !== "image" &&- commonSelectedType !== "image") ||- targetElements.some((element) => hasStrokeColor(element.type))) &&- renderAction("changeStrokeColor")}- {showChangeBackgroundIcons && renderAction("changeBackgroundColor")}+ <div>+ {((hasStrokeColor(appState.activeTool.type) &&+ appState.activeTool.type !== "image" &&+ commonSelectedType !== "image") ||+ targetElements.some((element) => hasStrokeColor(element.type))) &&+ renderAction("changeStrokeColor")}+ </div>+ {showChangeBackgroundIcons && (+ <div>{renderAction("changeBackgroundColor")}</div>+ )}{showFillIcons && renderAction("changeFillStyle")}{(hasStrokeWidth(appState.activeTool.type) ||@@ -163,7 +169,16 @@ export const SelectedShapeActions = ({)}{targetElements.length > 2 &&renderAction("distributeHorizontally")}- <div className="iconRow">+ {/* breaks the row ˇˇ */}+ <div style={{ flexBasis: "100%", height: 0 }} />+ <div+ style={{+ display: "flex",+ flexWrap: "wrap",+ gap: ".5rem",+ marginTop: "-0.5rem",+ }}+ >{renderAction("alignTop")}{renderAction("alignVerticallyCentered")}{renderAction("alignBottom")}@@ -203,22 +218,23 @@ export const ShapesSwitcher = ({appState: AppState;}) => (<>- {SHAPES.map(({ value, icon, key }, index) => {+ {SHAPES.map(({ value, icon, key, fillable }, index) => {+ const numberKey = value === "eraser" ? 0 : index + 1;const label = t(`toolBar.${value}`);const letter = key && (typeof key === "string" ? key : key[0]);const shortcut = letter- ? `${capitalizeString(letter)} ${t("helpDialog.or")} ${index + 1}`- : `${index + 1}`;+ ? `${capitalizeString(letter)} ${t("helpDialog.or")} ${numberKey}`+ : `${numberKey}`;return (<ToolButton- className="Shape"+ className={clsx("Shape", { fillable })}key={value}type="radio"icon={icon}checked={activeTool.type === value}name="editor-current-shape"title={`${capitalizeString(label)} — ${shortcut}`}- keyBindingLabel={`${index + 1}`}+ keyBindingLabel={`${numberKey}`}aria-label={capitalizeString(label)}aria-keyshortcuts={shortcut}data-testid={value}@@ -263,11 +279,11 @@ export const ZoomActions = ({renderAction: ActionManager["renderAction"];zoom: Zoom;}) => (- <Stack.Col gap={1}>- <Stack.Row gap={1} align="center">+ <Stack.Col gap={1} className="zoom-actions">+ <Stack.Row align="center">{renderAction("zoomOut")}- {renderAction("zoomIn")}{renderAction("resetZoom")}+ {renderAction("zoomIn")}</Stack.Row></Stack.Col>);@@ -280,8 +296,12 @@ export const UndoRedoActions = ({className?: string;}) => (<div className={`undo-redo-buttons ${className}`}>- {renderAction("undo", { size: "small" })}- {renderAction("redo", { size: "small" })}+ <div className="undo-button-container">+ <Tooltip label={t("buttons.undo")}>{renderAction("undo")}</Tooltip>+ </div>+ <div className="redo-button-container">+ <Tooltip label={t("buttons.redo")}> {renderAction("redo")}</Tooltip>+ </div></div>);diff --git a/src/components/ActiveFile.tsx b/src/components/ActiveFile.tsxindex a116601ce6..d6e7c8fa42 100644--- a/src/components/ActiveFile.tsx+++ b/src/components/ActiveFile.tsx@@ -1,9 +1,11 @@-import Stack from "../components/Stack";-import { ToolButton } from "../components/ToolButton";-import { save, file } from "../components/icons";+// TODO barnabasmolnar/editor-redesign+// this icon is not great+import { getShortcutFromShortcutName } from "../actions/shortcuts";+import { save } from "../components/icons";import { t } from "../i18n";import "./ActiveFile.scss";+import MenuItem from "./MenuItem";type ActiveFileProps = {fileName?: string;@@ -11,18 +13,11 @@ type ActiveFileProps = {};export const ActiveFile = ({ fileName, onSave }: ActiveFileProps) => (- <Stack.Row className="ActiveFile" gap={1} align="center">- <span className="ActiveFile__fileName">- {file}- <span>{fileName}</span>- </span>- <ToolButton- type="icon"- icon={save}- title={t("buttons.save")}- aria-label={t("buttons.save")}- onClick={onSave}- data-testid="save-button"- />- </Stack.Row>+ <MenuItem+ label={`${t("buttons.save")}`}+ shortcut={getShortcutFromShortcutName("saveScene")}+ dataTestId="save-button"+ onClick={onSave}+ icon={save}+ />);diff --git a/src/components/App.tsx b/src/components/App.tsxindex b812845966..5d2dac5222 100644--- a/src/components/App.tsx+++ b/src/components/App.tsx@@ -266,6 +266,10 @@ import {isLocalLink,} from "../element/Hyperlink";import { shouldShowBoundingBox } from "../element/transformHandles";+import { atom } from "jotai";++export const isMenuOpenAtom = atom(false);+export const isDropdownOpenAtom = atom(false);const deviceContextInitialValue = {isSmScreen: false,@@ -571,6 +575,11 @@ class App extends React.Component<AppProps, AppState> {library={this.library}id={this.id}onImageAction={this.onImageAction}+ renderWelcomeScreen={+ this.state.showWelcomeScreen &&+ this.state.activeTool.type === "selection" &&+ !this.scene.getElementsIncludingDeleted().length+ }/><div className="excalidraw-textEditorContainer" /><div className="excalidraw-contextMenuContainer" />@@ -1085,6 +1094,13 @@ class App extends React.Component<AppProps, AppState> {}componentDidUpdate(prevProps: AppProps, prevState: AppState) {+ if (+ !this.state.showWelcomeScreen &&+ !this.scene.getElementsIncludingDeleted().length+ ) {+ this.setState({ showWelcomeScreen: true });+ }+if (this.excalidrawContainerRef.current &&prevProps.UIOptions.dockedSidebarBreakpoint !==@@ -1276,6 +1292,10 @@ class App extends React.Component<AppProps, AppState> {);});+ const selectionColor = getComputedStyle(+ document.querySelector(".excalidraw")!,+ ).getPropertyValue("--color-selection");+renderScene({elements: renderingElements,@@ -1284,6 +1304,7 @@ class App extends React.Component<AppProps, AppState> {rc: this.rc!,canvas: this.canvas!,renderConfig: {+ selectionColor,scrollX: this.state.scrollX,scrollY: this.state.scrollY,viewBackgroundColor: this.state.viewBackgroundColor,@@ -1867,8 +1888,16 @@ class App extends React.Component<AppProps, AppState> {if (event.key === KEYS.QUESTION_MARK) {this.setState({- showHelpDialog: true,+ openDialog: "help",});+ return;+ } else if (+ event.key.toLowerCase() === KEYS.E &&+ event.shiftKey &&+ event[KEYS.CTRL_OR_CMD]+ ) {+ this.setState({ openDialog: "imageExport" });+ return;}if (this.actionManager.handleKeyDown(event)) {diff --git a/src/components/Avatar.scss b/src/components/Avatar.scssindex d3f8c8bd30..90e5ce96a7 100644--- a/src/components/Avatar.scss+++ b/src/components/Avatar.scss@@ -2,16 +2,19 @@.excalidraw {.Avatar {- width: 2.5rem;- height: 2.5rem;- border-radius: 1.25rem;+ width: 1.25rem;+ height: 1.25rem;+ border-radius: 100%;+ outline: 2px solid var(--avatar-border-color);+ outline-offset: 2px;display: flex;justify-content: center;align-items: center;color: $oc-white;cursor: pointer;- font-size: 0.8rem;+ font-size: 0.625rem;font-weight: 500;+ line-height: 1;&-img {width: 100%;diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsxindex 9af4dab586..57a7eec261 100644--- a/src/components/Avatar.tsx+++ b/src/components/Avatar.tsx@@ -11,13 +11,11 @@ type AvatarProps = {src?: string;};-export const Avatar = ({ color, border, onClick, name, src }: AvatarProps) => {+export const Avatar = ({ color, onClick, name, src }: AvatarProps) => {const shortName = getClientInitials(name);const [error, setError] = useState(false);const loadImg = !error && src;- const style = loadImg- ? undefined- : { background: color, border: `1px solid ${border}` };+ const style = loadImg ? undefined : { background: color };return (<div className="Avatar" style={style} onClick={onClick}>{loadImg ? (diff --git a/src/components/BackgroundPickerAndDarkModeToggle.tsx b/src/components/BackgroundPickerAndDarkModeToggle.tsxdeleted file mode 100644index 603a99a921..0000000000--- a/src/components/BackgroundPickerAndDarkModeToggle.tsx+++ /dev/null@@ -1,12 +0,0 @@-import { ActionManager } from "../actions/manager";--export const BackgroundPickerAndDarkModeToggle = ({- actionManager,-}: {- actionManager: ActionManager;-}) => (- <div style={{ display: "flex" }}>- {actionManager.renderAction("changeViewBackgroundColor")}- {actionManager.renderAction("toggleTheme")}- </div>-);diff --git a/src/components/CheckboxItem.scss b/src/components/CheckboxItem.scssindex a0a25ca099..f6439498c4 100644--- a/src/components/CheckboxItem.scss+++ b/src/components/CheckboxItem.scss@@ -64,6 +64,8 @@color: #{$oc-blue-7};+ border: 0;+&:focus {box-shadow: 0 0 0 3px #{$oc-blue-7};}diff --git a/src/components/ClearCanvas.tsx b/src/components/ClearCanvas.tsxindex ab1cd6704f..d6f8ee393e 100644--- a/src/components/ClearCanvas.tsx+++ b/src/components/ClearCanvas.tsx@@ -1,10 +1,9 @@import { useState } from "react";import { t } from "../i18n";-import { useDevice } from "./App";-import { trash } from "./icons";-import { ToolButton } from "./ToolButton";+import { TrashIcon } from "./icons";import ConfirmDialog from "./ConfirmDialog";+import MenuItem from "./MenuItem";const ClearCanvas = ({ onConfirm }: { onConfirm: () => void }) => {const [showDialog, setShowDialog] = useState(false);@@ -14,14 +13,11 @@ const ClearCanvas = ({ onConfirm }: { onConfirm: () => void }) => {return (<>- <ToolButton- type="button"- icon={trash}- title={t("buttons.clearReset")}- aria-label={t("buttons.clearReset")}- showAriaLabel={useDevice().isMobile}+ <MenuItem+ label={t("buttons.clearReset")}+ icon={TrashIcon}onClick={toggleDialog}- data-testid="clear-canvas-button"+ dataTestId="clear-canvas-button"/>{showDialog && (diff --git a/src/components/CollabButton.scss b/src/components/CollabButton.scssindex 93abb07cc1..4e09d11c72 100644--- a/src/components/CollabButton.scss+++ b/src/components/CollabButton.scss@@ -1,6 +1,51 @@@import "../css/variables.module";.excalidraw {+ .collab-button {+ @include outlineButtonStyles;+ width: var(--lg-button-size);+ height: var(--lg-button-size);++ svg {+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);+ }+ background-color: var(--color-primary);+ border-color: var(--color-primary);+ color: white;+ flex-shrink: 0;++ &:hover {+ background-color: var(--color-primary-darker);+ border-color: var(--color-primary-darker);+ }++ &:active {+ background-color: var(--color-primary-darker);+ }++ &.active {+ background-color: #0fb884;+ border-color: #0fb884;++ svg {+ color: #fff;+ }++ &:hover,+ &:active {+ background-color: #0fb884;+ border-color: #0fb884;+ }+ }+ }++ &.theme--dark {+ .collab-button {+ color: var(--color-gray-90);+ }+ }+.CollabButton.is-collaborating {background-color: var(--button-special-active-bg-color);@@ -24,9 +69,9 @@bottom: -5px;padding: 3px;border-radius: 50%;- background-color: $oc-green-6;- color: $oc-white;- font-size: 0.6em;+ background-color: $oc-green-2;+ color: $oc-green-9;+ font-size: 0.6rem;font-family: "Cascadia";}}diff --git a/src/components/CollabButton.tsx b/src/components/CollabButton.tsxindex c2f642744e..12df839bb3 100644--- a/src/components/CollabButton.tsx+++ b/src/components/CollabButton.tsx@@ -1,37 +1,47 @@-import clsx from "clsx";-import { ToolButton } from "./ToolButton";import { t } from "../i18n";-import { useDevice } from "../components/App";-import { users } from "./icons";+import { UsersIcon } from "./icons";import "./CollabButton.scss";+import MenuItem from "./MenuItem";+import clsx from "clsx";const CollabButton = ({isCollaborating,collaboratorCount,onClick,+ isInHamburgerMenu = true,}: {isCollaborating: boolean;collaboratorCount: number;onClick: () => void;+ isInHamburgerMenu?: boolean;}) => {return (<>- <ToolButton- className={clsx("CollabButton", {- "is-collaborating": isCollaborating,- })}- onClick={onClick}- icon={users}- type="button"- title={t("labels.liveCollaboration")}- aria-label={t("labels.liveCollaboration")}- showAriaLabel={useDevice().isMobile}- >- {isCollaborating && (- <div className="CollabButton-collaborators">{collaboratorCount}</div>- )}- </ToolButton>+ {isInHamburgerMenu ? (+ <MenuItem+ label={t("labels.liveCollaboration")}+ dataTestId="collab-button"+ icon={UsersIcon}+ onClick={onClick}+ isCollaborating={isCollaborating}+ />+ ) : (+ <button+ className={clsx("collab-button", { active: isCollaborating })}+ type="button"+ onClick={onClick}+ style={{ position: "relative" }}+ title={t("labels.liveCollaboration")}+ >+ {UsersIcon}+ {collaboratorCount > 0 && (+ <div className="CollabButton-collaborators">+ {collaboratorCount}+ </div>+ )}+ </button>+ )}</>);};diff --git a/src/components/ColorPicker.scss b/src/components/ColorPicker.scssindex fdcb9baa93..52ea20a195 100644--- a/src/components/ColorPicker.scss+++ b/src/components/ColorPicker.scss@@ -21,6 +21,23 @@display: grid;grid-template-columns: auto 1fr;align-items: center;+ column-gap: 0.5rem;+ }++ .color-picker-control-container + .popover {+ position: static;+ }++ .color-picker-popover-container {+ margin-top: -0.25rem;++ :root[dir="ltr"] & {+ margin-left: 0.5rem;+ }++ :root[dir="rtl"] & {+ margin-left: -3rem;+ }}.color-picker-triangle {@@ -30,20 +47,29 @@border-width: 0 9px 10px;border-color: transparent transparent var(--popup-bg-color);position: absolute;- top: -10px;+ top: 10px;:root[dir="ltr"] & {- left: 12px;+ transform: rotate(270deg);+ left: -14px;}:root[dir="rtl"] & {- right: 12px;+ transform: rotate(90deg);+ right: -14px;}}.color-picker-triangle-shadow {border-color: transparent transparent transparentize($oc-black, 0.9);- top: -11px;++ :root[dir="ltr"] & {+ left: -14px;+ }++ :root[dir="rtl"] & {+ right: -16px;+ }}.color-picker-content--default {@@ -119,16 +145,21 @@}.color-picker-hash {- background: var(--input-border-color);- height: 1.875rem;- width: 1.875rem;+ height: var(--default-button-size);+ flex-shrink: 0;+ padding: 0.5rem 0.5rem 0.5rem 0.75rem;+ border: 1px solid var(--default-border-color);+ border-right: 0;+ box-sizing: border-box;:root[dir="ltr"] & {- border-radius: 4px 0 0 4px;+ border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);}:root[dir="rtl"] & {- border-radius: 0 4px 4px 0;+ border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;+ border-right: 1px solid var(--default-border-color);+ border-left: 0;}color: var(--input-label-color);@@ -138,81 +169,64 @@position: relative;}- .color-input-container:focus-within .color-picker-hash {- box-shadow: 0 0 0 2px var(--focus-highlight-color);- }-- .color-input-container:focus-within .color-picker-hash::before,- .color-input-container:focus-within .color-picker-hash::after {- content: "";- width: 1px;- height: 100%;- position: absolute;- top: 0;- }-- .color-input-container:focus-within .color-picker-hash::before {- background: var(--input-border-color);-- :root[dir="ltr"] & {- right: -1px;- }-- :root[dir="rtl"] & {- left: -1px;- }- }-- .color-input-container:focus-within .color-picker-hash::after {- background: var(--input-bg-color);-- :root[dir="ltr"] & {- right: -2px;- }-- :root[dir="rtl"] & {- left: -2px;- }- }-.color-input-container {display: flex;++ &:focus-within {+ box-shadow: 0 0 0 1px var(--color-primary-darkest);+ border-radius: var(--border-radius-lg);+ }}.color-picker-input {- width: 11ch; /* length of `transparent` */+ box-sizing: border-box;+ width: 100%;margin: 0;- font-size: 1rem;- background-color: var(--input-bg-color);+ font-size: 0.875rem;+ background-color: transparent;color: var(--text-primary-color);border: 0;outline: none;- height: 1.75em;- box-shadow: var(--input-border-color) 0 0 0 1px inset;+ height: var(--default-button-size);+ border: 1px solid var(--default-border-color);+ border-left: 0;+ letter-spacing: 0.4px;:root[dir="ltr"] & {- border-radius: 0 4px 4px 0;+ border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;}:root[dir="rtl"] & {- border-radius: 4px 0 0 4px;+ border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);+ border-left: 1px solid var(--default-border-color);+ border-right: 0;}- float: left;- padding: 1px;- padding-inline-start: 0.5em;+ padding: 0.5rem;+ padding-left: 0.25rem;appearance: none;++ &:focus-visible {+ box-shadow: none;+ }+ }++ .color-picker-label-swatch-container {+ border: 1px solid var(--default-border-color);+ border-radius: var(--border-radius-lg);+ width: var(--default-button-size);+ height: var(--default-button-size);+ box-sizing: border-box;+ overflow: hidden;}.color-picker-label-swatch {- height: 1.875rem;- width: 1.875rem;- margin-inline-end: 0.25rem;- border: 1px solid $oc-gray-3;- position: relative;+ @include outlineButtonStyles;+ background-color: var(--swatch-color) !important;overflow: hidden;- background-color: transparent !important;+ position: relative;filter: var(--theme-filter);+ border: 0 !important;&:after {content: "";diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsxindex 22f9eb267c..03ab4a5be9 100644--- a/src/components/ColorPicker.tsx+++ b/src/components/ColorPicker.tsx@@ -365,17 +365,20 @@ export const ColorPicker = ({appState: AppState;}) => {const pickerButton = React.useRef<HTMLButtonElement>(null);+ const coords = pickerButton.current?.getBoundingClientRect();return (<div><div className="color-picker-control-container">- <button- className="color-picker-label-swatch"- aria-label={label}- style={color ? { "--swatch-color": color } : undefined}- onClick={() => setActive(!isActive)}- ref={pickerButton}- />+ <div className="color-picker-label-swatch-container">+ <button+ className="color-picker-label-swatch"+ aria-label={label}+ style={color ? { "--swatch-color": color } : undefined}+ onClick={() => setActive(!isActive)}+ ref={pickerButton}+ />+ </div><ColorInputcolor={color}label={label}@@ -386,27 +389,37 @@ export const ColorPicker = ({</div><React.Suspense fallback="">{isActive ? (- <Popover- onCloseRequest={(event) =>- event.target !== pickerButton.current && setActive(false)- }+ <div+ className="color-picker-popover-container"+ style={{+ position: "fixed",+ top: coords?.top,+ left: coords?.right,+ zIndex: 1,+ }}>- <Picker- colors={colors[type]}- color={color || null}- onChange={(changedColor) => {- onChange(changedColor);- }}- onClose={() => {- setActive(false);- pickerButton.current?.focus();- }}- label={label}- showInput={false}- type={type}- elements={elements}- />- </Popover>+ <Popover+ onCloseRequest={(event) =>+ event.target !== pickerButton.current && setActive(false)+ }+ >+ <Picker+ colors={colors[type]}+ color={color || null}+ onChange={(changedColor) => {+ onChange(changedColor);+ }}+ onClose={() => {+ setActive(false);+ pickerButton.current?.focus();+ }}+ label={label}+ showInput={false}+ type={type}+ elements={elements}+ />+ </Popover>+ </div>) : null}</React.Suspense></div>diff --git a/src/components/ConfirmDialog.scss b/src/components/ConfirmDialog.scssindex d3987fcc5b..82a6dff9b9 100644--- a/src/components/ConfirmDialog.scss+++ b/src/components/ConfirmDialog.scss@@ -4,34 +4,8 @@.confirm-dialog {&-buttons {display: flex;- padding: 0.2rem 0;+ column-gap: 0.5rem;justify-content: flex-end;}- .ToolIcon__icon {- min-width: 2.5rem;- width: auto;- font-size: 1rem;- }-- .ToolIcon_type_button {- margin-left: 0.8rem;- padding: 0 0.5rem;- }-- &__content {- font-size: 1rem;- }-- &--confirm.ToolIcon_type_button {- background-color: $oc-red-6;-- &:hover {- background-color: $oc-red-8;- }-- .ToolIcon__icon {- color: $oc-white;- }- }}}diff --git a/src/components/ConfirmDialog.tsx b/src/components/ConfirmDialog.tsxindex 459787dfbc..30faef7885 100644--- a/src/components/ConfirmDialog.tsx+++ b/src/components/ConfirmDialog.tsx@@ -1,8 +1,11 @@import { t } from "../i18n";import { Dialog, DialogProps } from "./Dialog";-import { ToolButton } from "./ToolButton";import "./ConfirmDialog.scss";+import DialogActionButton from "./DialogActionButton";+import { isMenuOpenAtom } from "./App";+import { isDropdownOpenAtom } from "./App";+import { useSetAtom } from "jotai";interface Props extends Omit<DialogProps, "onCloseRequest"> {onConfirm: () => void;@@ -20,6 +23,10 @@ const ConfirmDialog = (props: Props) => {className = "",...rest} = props;++ const setIsMenuOpen = useSetAtom(isMenuOpenAtom);+ const setIsDropdownOpen = useSetAtom(isDropdownOpenAtom);+return (<DialogonCloseRequest={onCancel}@@ -29,21 +36,22 @@ const ConfirmDialog = (props: Props) => {>{children}<div className="confirm-dialog-buttons">- <ToolButton- type="button"- title={cancelText}- aria-label={cancelText}+ <DialogActionButtonlabel={cancelText}- onClick={onCancel}- className="confirm-dialog--cancel"+ onClick={() => {+ setIsMenuOpen(false);+ setIsDropdownOpen(false);+ onCancel();+ }}/>- <ToolButton- type="button"- title={confirmText}- aria-label={confirmText}+ <DialogActionButtonlabel={confirmText}- onClick={onConfirm}- className="confirm-dialog--confirm"+ onClick={() => {+ setIsMenuOpen(false);+ setIsDropdownOpen(false);+ onConfirm();+ }}+ actionType="danger"/></div></Dialog>diff --git a/src/components/Dialog.scss b/src/components/Dialog.scssindex 435c56b60d..604b3c64e3 100644--- a/src/components/Dialog.scss+++ b/src/components/Dialog.scss@@ -7,68 +7,11 @@}.Dialog__title {- display: grid;- align-items: center;- margin-top: 0;- grid-template-columns: 1fr calc(var(--space-factor) * 7);- grid-gap: var(--metric);- padding: calc(var(--space-factor) * 2);- text-align: center;- font-variant: small-caps;- font-size: 1.2em;- }-- .Dialog__titleContent {- flex: 1;- }-- .Dialog .Modal__close {- color: var(--icon-fill-color);margin: 0;- }-- .Dialog__content {- padding: 0 16px 16px;- }-- @include isMobile {- .Dialog {- --metric: calc(var(--space-factor) * 4);- --inset-left: #{"max(var(--metric), var(--sal))"};- --inset-right: #{"max(var(--metric), var(--sar))"};- }-- .Dialog__title {- grid-template-columns: calc(var(--space-factor) * 7) 1fr calc(- var(--space-factor) * 7- );- position: sticky;- top: 0;- padding: calc(var(--space-factor) * 2);- background: var(--island-bg-color);- font-size: 1.25em;-- box-sizing: border-box;- border-bottom: 1px solid var(--button-gray-2);- z-index: 1;- }-- .Dialog__titleContent {- text-align: center;- }-- .Dialog .Island {- width: 100vw;- height: 100%;- box-sizing: border-box;- overflow-y: auto;- padding-left: #{"max(calc(var(--padding) * var(--space-factor)), var(--sal))"};- padding-right: #{"max(calc(var(--padding) * var(--space-factor)), var(--sar))"};- padding-bottom: #{"max(calc(var(--padding) * var(--space-factor)), var(--sab))"};- }-- .Dialog .Modal__close {- order: -1;- }+ text-align: left;+ font-size: 1.25rem;+ border-bottom: 1px solid var(--dialog-border-color);+ padding: 0 0 0.75rem;+ margin-bottom: 1.5rem;}}diff --git a/src/components/Dialog.tsx b/src/components/Dialog.tsxindex 67ad904e7c..51d3399448 100644--- a/src/components/Dialog.tsx+++ b/src/components/Dialog.tsx@@ -5,11 +5,13 @@ import { t } from "../i18n";import { useExcalidrawContainer, useDevice } from "../components/App";import { KEYS } from "../keys";import "./Dialog.scss";-import { back, close } from "./icons";+import { back, CloseIcon } from "./icons";import { Island } from "./Island";import { Modal } from "./Modal";import { AppState } from "../types";import { queryFocusableElements } from "../utils";+import { isMenuOpenAtom, isDropdownOpenAtom } from "./App";+import { useSetAtom } from "jotai";export interface DialogProps {children: React.ReactNode;@@ -65,7 +67,12 @@ export const Dialog = (props: DialogProps) => {return () => islandNode.removeEventListener("keydown", handleKeyDown);}, [islandNode, props.autofocus]);+ const setIsMenuOpen = useSetAtom(isMenuOpenAtom);+ const setIsDropdownOpen = useSetAtom(isDropdownOpenAtom);+const onClose = () => {+ setIsMenuOpen(false);+ setIsDropdownOpen(false);(lastActiveElement as HTMLElement).focus();props.onCloseRequest();};@@ -88,7 +95,7 @@ export const Dialog = (props: DialogProps) => {title={t("buttons.close")}aria-label={t("buttons.close")}>- {useDevice().isMobile ? back : close}+ {useDevice().isMobile ? back : CloseIcon}</button></h2><div className="Dialog__content">{props.children}</div>diff --git a/src/components/DialogActionButton.scss b/src/components/DialogActionButton.scssnew file mode 100644index 0000000000..54c44ba161--- /dev/null+++ b/src/components/DialogActionButton.scss@@ -0,0 +1,47 @@+.excalidraw {+ .Dialog__action-button {+ position: relative;+ display: flex;+ column-gap: 0.5rem;+ align-items: center;+ padding: 0.5rem 1.5rem;+ border: 1px solid var(--default-border-color);+ background-color: transparent;+ height: 3rem;+ border-radius: var(--border-radius-lg);+ letter-spacing: 0.4px;+ color: inherit;+ font-family: inherit;+ font-size: 0.875rem;+ font-weight: 600;+ user-select: none;++ svg {+ display: block;+ width: 1rem;+ height: 1rem;+ }++ &--danger {+ background-color: var(--color-danger);+ border-color: var(--color-danger);+ color: #fff;+ }++ &--primary {+ background-color: var(--color-primary);+ border-color: var(--color-primary);+ color: #fff;+ }+ }++ &.theme--dark {+ .Dialog__action-button--danger {+ color: var(--color-gray-100);+ }++ .Dialog__action-button--primary {+ color: var(--color-gray-100);+ }+ }+}diff --git a/src/components/DialogActionButton.tsx b/src/components/DialogActionButton.tsxnew file mode 100644index 0000000000..17f202362d--- /dev/null+++ b/src/components/DialogActionButton.tsx@@ -0,0 +1,46 @@+import clsx from "clsx";+import { ReactNode } from "react";+import "./DialogActionButton.scss";+import Spinner from "./Spinner";++interface DialogActionButtonProps {+ label: string;+ children?: ReactNode;+ actionType?: "primary" | "danger";+ isLoading?: boolean;+}++const DialogActionButton = ({+ label,+ onClick,+ className,+ children,+ actionType,+ type = "button",+ isLoading,+ ...rest+}: DialogActionButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => {+ const cs = actionType ? `Dialog__action-button--${actionType}` : "";++ return (+ <button+ className={clsx("Dialog__action-button", cs, className)}+ type={type}+ aria-label={label}+ onClick={onClick}+ {...rest}+ >+ {children && (+ <div style={isLoading ? { visibility: "hidden" } : {}}>{children}</div>+ )}+ <div style={isLoading ? { visibility: "hidden" } : {}}>{label}</div>+ {isLoading && (+ <div style={{ position: "absolute", inset: 0 }}>+ <Spinner />+ </div>+ )}+ </button>+ );+};++export default DialogActionButton;diff --git a/src/components/EncryptedIcon.tsx b/src/components/EncryptedIcon.tsxnew file mode 100644index 0000000000..12a936c34f--- /dev/null+++ b/src/components/EncryptedIcon.tsx@@ -0,0 +1,19 @@+import { t } from "../i18n";+import { shield } from "./icons";+import { Tooltip } from "./Tooltip";++const EncryptedIcon = () => (+ <a+ className="encrypted-icon tooltip"+ href="https://blog.excalidraw.com/end-to-end-encryption/"+ target="_blank"+ rel="noopener noreferrer"+ aria-label={t("encrypted.link")}+ >+ <Tooltip label={t("encrypted.tooltip")} long={true}>+ {shield}+ </Tooltip>+ </a>+);++export default EncryptedIcon;diff --git a/src/components/ExportDialog.scss b/src/components/ExportDialog.scssindex 4d476a1e34..c95a116e7e 100644--- a/src/components/ExportDialog.scss+++ b/src/components/ExportDialog.scss@@ -91,6 +91,8 @@}button.ExportDialog-imageExportButton {+ border: 0;+width: 5rem;height: 5rem;margin: 0 0.2em;diff --git a/src/components/FixedSideContainer.scss b/src/components/FixedSideContainer.scssindex 62b9869fd2..85d0ef0836 100644--- a/src/components/FixedSideContainer.scss+++ b/src/components/FixedSideContainer.scss@@ -9,9 +9,10 @@}.FixedSideContainer_side_top {- left: var(--space-factor);- top: var(--space-factor);- right: var(--space-factor);+ left: 1rem;+ top: 1rem;+ right: 1rem;+ bottom: 1rem;z-index: 2;}diff --git a/src/components/Footer.tsx b/src/components/Footer.tsxindex 0fbcd73d9b..825226011a 100644--- a/src/components/Footer.tsx+++ b/src/components/Footer.tsx@@ -1,5 +1,6 @@import clsx from "clsx";import { ActionManager } from "../actions/manager";+import { t } from "../i18n";import { AppState, ExcalidrawProps } from "../types";import {ExitZenModeAction,@@ -8,20 +9,23 @@ import {ZoomActions,} from "./Actions";import { useDevice } from "./App";-import { Island } from "./Island";+import { WelcomeScreenHelpArrow } from "./icons";import { Section } from "./Section";import Stack from "./Stack";+import WelcomeScreenDecor from "./WelcomeScreenDecor";const Footer = ({appState,actionManager,renderCustomFooter,showExitZenModeBtn,+ renderWelcomeScreen,}: {appState: AppState;actionManager: ActionManager;renderCustomFooter?: ExcalidrawProps["renderFooter"];showExitZenModeBtn: boolean;+ renderWelcomeScreen: boolean;}) => {const device = useDevice();const showFinalize =@@ -39,31 +43,19 @@ const Footer = ({><Stack.Col gap={2}><Section heading="canvasActions">- <Island padding={1}>- <ZoomActions+ <ZoomActions+ renderAction={actionManager.renderAction}+ zoom={appState.zoom}+ />++ {!appState.viewModeEnabled && (+ <UndoRedoActionsrenderAction={actionManager.renderAction}- zoom={appState.zoom}+ className={clsx("zen-mode-transition", {+ "layer-ui__wrapper__footer-left--transition-bottom":+ appState.zenModeEnabled,+ })}/>- </Island>- {!appState.viewModeEnabled && (- <>- <UndoRedoActions- renderAction={actionManager.renderAction}- className={clsx("zen-mode-transition", {- "layer-ui__wrapper__footer-left--transition-bottom":- appState.zenModeEnabled,- })}- />-- <div- className={clsx("eraser-buttons zen-mode-transition", {- "layer-ui__wrapper__footer-left--transition-left":- appState.zenModeEnabled,- })}- >- {actionManager.renderAction("eraser", { size: "small" })}- </div>- </>)}{showFinalize && (<FinalizeAction@@ -93,7 +85,18 @@ const Footer = ({"transition-right disable-pointerEvents": appState.zenModeEnabled,})}>- {actionManager.renderAction("toggleShortcuts")}+ <div style={{ position: "relative" }}>+ <WelcomeScreenDecor+ shouldRender={renderWelcomeScreen && !appState.isLoading}+ >+ <div className="virgil WelcomeScreen-decor WelcomeScreen-decor--help-pointer">+ <div>{t("welcomeScreen.helpHints")}</div>+ {WelcomeScreenHelpArrow}+ </div>+ </WelcomeScreenDecor>++ {actionManager.renderAction("toggleShortcuts")}+ </div></div><ExitZenModeActionactionManager={actionManager}diff --git a/src/components/HelpIcon.tsx b/src/components/HelpButton.tsxsimilarity index 61%rename from src/components/HelpIcon.tsxrename to src/components/HelpButton.tsxindex 6553c32454..40c130271e 100644--- a/src/components/HelpIcon.tsx+++ b/src/components/HelpButton.tsx@@ -1,13 +1,13 @@-import { questionCircle } from "../components/icons";+import { HelpIcon } from "./icons";-type HelpIconProps = {+type HelpButtonProps = {title?: string;name?: string;id?: string;onClick?(): void;};-export const HelpIcon = (props: HelpIconProps) => (+export const HelpButton = (props: HelpButtonProps) => (<buttonclassName="help-icon"onClick={props.onClick}@@ -15,6 +15,6 @@ export const HelpIcon = (props: HelpIconProps) => (title={`${props.title} — ?`}aria-label={props.title}>- {questionCircle}+ {HelpIcon}</button>);diff --git a/src/components/HelpDialog.scss b/src/components/HelpDialog.scssindex 6b5701b846..8a0a08f3c4 100644--- a/src/components/HelpDialog.scss+++ b/src/components/HelpDialog.scss@@ -1,56 +1,115 @@@import "../css/variables.module";.excalidraw {- .HelpDialog h3 {- border-bottom: 1px solid var(--button-gray-2);- padding-bottom: 4px;- }+ .HelpDialog {+ .Modal__content {+ max-width: 960px;+ }- .HelpDialog--island {- border: 1px solid var(--button-gray-2);- margin-bottom: 16px;- }+ h3 {+ margin: 1.5rem 0;+ font-weight: bold;+ font-size: 1.125rem;+ }- .HelpDialog--island-title {- margin: 0;- padding: 4px;- background-color: var(--button-gray-1);- text-align: center;- }+ &__header {+ display: flex;+ flex-wrap: wrap;+ gap: 0.75rem;+ }- .HelpDialog--shortcut {- border-top: 1px solid var(--button-gray-2);- }+ &__btn {+ display: flex;+ column-gap: 0.5rem;+ align-items: center;+ border: 1px solid var(--default-border-color);+ padding: 0.625rem 1rem;+ border-radius: var(--border-radius-lg);+ color: var(--text-primary-color);+ font-weight: 600;+ font-size: 0.75rem;+ letter-spacing: 0.4px;- .HelpDialog--key {- word-break: keep-all;- border: 1px solid var(--button-gray-2);- padding: 2px 8px;- margin: auto 4px;- background-color: var(--button-gray-1);- border-radius: 2px;- font-size: 0.8em;- min-height: 26px;- box-sizing: border-box;- display: flex;- align-items: center;- font-family: inherit;- }+ &:hover {+ text-decoration: none;+ }+ }- .HelpDialog--header {- display: flex;- flex-direction: row;- justify-content: space-evenly;- margin-bottom: 32px;- padding-bottom: 16px;- }+ &__link-icon {+ line-height: 0;+ svg {+ width: 1rem;+ height: 1rem;+ }+ }- .HelpDialog--btn {- border: 1px solid var(--link-color);- padding: 8px 32px;- border-radius: 4px;- }- .HelpDialog--btn:hover {- text-decoration: none;+ &__islands-container {+ display: grid;+ @media screen and (min-width: 1024px) {+ grid-template-columns: 1fr 1fr;+ }+ grid-column-gap: 1.5rem;+ grid-row-gap: 2rem;+ }++ @media screen and (min-width: 1024px) {+ &__island--tools {+ grid-area: 1 / 1 / 2 / 2;+ }+ &__island--view {+ grid-area: 2 / 1 / 3 / 2;+ }+ &__island--editor {+ grid-area: 1 / 2 / 3 / 3;+ }+ }++ &__island {+ h4 {+ font-size: 1rem;+ font-weight: bold;+ margin: 0;+ margin-bottom: 0.625rem;+ }++ &-content {+ border: 1px solid var(--dialog-border-color);+ border-radius: var(--border-radius-lg);+ }+ }++ &__shortcut {+ border-bottom: 1px solid var(--dialog-border-color);+ padding: 0.375rem 0.75rem;+ display: flex;+ justify-content: space-between;+ align-items: center;+ font-size: 0.875rem;+ column-gap: 0.5rem;++ &:last-child {+ border-bottom: none;+ }+ }++ &__key-container {+ display: flex;+ align-items: center;+ column-gap: 0.25rem;+ flex-shrink: 0;+ }++ &__key {+ display: flex;+ box-sizing: border-box;+ font-size: 0.625rem;+ background-color: var(--color-primary-light);+ border-radius: var(--border-radius-md);+ padding: 0.5rem;+ word-break: keep-all;+ align-items: center;+ font-family: inherit;+ line-height: 1;+ }}}diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsxindex 34d24f4839..96edf05fc6 100644--- a/src/components/HelpDialog.tsx+++ b/src/components/HelpDialog.tsx@@ -4,32 +4,36 @@ import { isDarwin, isWindows } from "../keys";import { Dialog } from "./Dialog";import { getShortcutKey } from "../utils";import "./HelpDialog.scss";+import { ExternalLinkIcon } from "./icons";const Header = () => (- <div className="HelpDialog--header">+ <div className="HelpDialog__header"><a- className="HelpDialog--btn"+ className="HelpDialog__btn"href="https://github.com/excalidraw/excalidraw#documentation"target="_blank"rel="noopener noreferrer">{t("helpDialog.documentation")}+ <div className="HelpDialog__link-icon">{ExternalLinkIcon}</div></a><a- className="HelpDialog--btn"+ className="HelpDialog__btn"href="https://blog.excalidraw.com"target="_blank"rel="noopener noreferrer">{t("helpDialog.blog")}+ <div className="HelpDialog__link-icon">{ExternalLinkIcon}</div></a><a- className="HelpDialog--btn"+ className="HelpDialog__btn"href="https://github.com/excalidraw/excalidraw/issues"target="_blank"rel="noopener noreferrer">{t("helpDialog.github")}+ <div className="HelpDialog__link-icon">{ExternalLinkIcon}</div></a></div>);@@ -37,88 +41,61 @@ const Header = () => (const Section = (props: { title: string; children: React.ReactNode }) => (<><h3>{props.title}</h3>- {props.children}+ <div className="HelpDialog__islands-container">{props.children}</div></>);-const Columns = (props: { children: React.ReactNode }) => (- <div- style={{- display: "flex",- flexDirection: "row",- flexWrap: "wrap",- justifyContent: "space-between",- }}- >- {props.children}- </div>-);--const Column = (props: { children: React.ReactNode }) => (- <div style={{ width: "49%" }}>{props.children}</div>-);-const ShortcutIsland = (props: {caption: string;children: React.ReactNode;+ className?: string;}) => (- <div className="HelpDialog--island">- <h3 className="HelpDialog--island-title">{props.caption}</h3>- {props.children}+ <div className={`HelpDialog__island ${props.className}`}>+ <h4 className="HelpDialog__island-title">{props.caption}</h4>+ <div className="HelpDialog__island-content">{props.children}</div></div>);-const Shortcut = (props: {+function* intersperse(as: JSX.Element[][], delim: string | null) {+ let first = true;+ for (const x of as) {+ if (!first) {+ yield delim;+ }+ first = false;+ yield x;+ }+}++const Shortcut = ({+ label,+ shortcuts,+ isOr = true,+}: {label: string;shortcuts: string[];- isOr: boolean;+ isOr?: boolean;}) => {+ const splitShortcutKeys = shortcuts.map((shortcut) => {+ const keys = shortcut.endsWith("++")+ ? [...shortcut.slice(0, -2).split("+"), "+"]+ : shortcut.split("+");++ return keys.map((key) => <ShortcutKey key={key}>{key}</ShortcutKey>);+ });+return (- <div className="HelpDialog--shortcut">- <div- style={{- display: "flex",- margin: "0",- padding: "4px 8px",- alignItems: "center",- }}- >- <div- style={{- lineHeight: 1.4,- }}- >- {props.label}- </div>- <div- style={{- display: "flex",- flex: "0 0 auto",- justifyContent: "flex-end",- marginInlineStart: "auto",- minWidth: "30%",- }}- >- {props.shortcuts.map((shortcut, index) => (- <React.Fragment key={index}>- <ShortcutKey>{shortcut}</ShortcutKey>- {props.isOr &&- index !== props.shortcuts.length - 1 &&- t("helpDialog.or")}- </React.Fragment>- ))}- </div>+ <div className="HelpDialog__shortcut">+ <div>{label}</div>+ <div className="HelpDialog__key-container">+ {[...intersperse(splitShortcutKeys, isOr ? t("helpDialog.or") : null)]}</div></div>);};-Shortcut.defaultProps = {- isOr: true,-};-const ShortcutKey = (props: { children: React.ReactNode }) => (- <kbd className="HelpDialog--key" {...props} />+ <kbd className="HelpDialog__key" {...props} />);export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {@@ -137,286 +114,276 @@ export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {><Header /><Section title={t("helpDialog.shortcuts")}>- <Columns>- <Column>- <ShortcutIsland caption={t("helpDialog.tools")}>- <Shortcut- label={t("toolBar.selection")}- shortcuts={["V", "1"]}- />- <Shortcut- label={t("toolBar.rectangle")}- shortcuts={["R", "2"]}- />- <Shortcut label={t("toolBar.diamond")} shortcuts={["D", "3"]} />- <Shortcut label={t("toolBar.ellipse")} shortcuts={["O", "4"]} />- <Shortcut label={t("toolBar.arrow")} shortcuts={["A", "5"]} />- <Shortcut label={t("toolBar.line")} shortcuts={["P", "6"]} />- <Shortcut- label={t("toolBar.freedraw")}- shortcuts={["Shift + P", "X", "7"]}- />- <Shortcut label={t("toolBar.text")} shortcuts={["T", "8"]} />- <Shortcut label={t("toolBar.image")} shortcuts={["9"]} />- <Shortcut label={t("toolBar.library")} shortcuts={["0"]} />- <Shortcut- label={t("toolBar.eraser")}- shortcuts={[getShortcutKey("E")]}- />- <Shortcut- label={t("helpDialog.editSelectedShape")}- shortcuts={[- getShortcutKey("Enter"),- t("helpDialog.doubleClick"),- ]}- />- <Shortcut- label={t("helpDialog.textNewLine")}- shortcuts={[- getShortcutKey("Enter"),- getShortcutKey("Shift+Enter"),- ]}- />- <Shortcut- label={t("helpDialog.textFinish")}- shortcuts={[- getShortcutKey("Esc"),- getShortcutKey("CtrlOrCmd+Enter"),- ]}- />- <Shortcut- label={t("helpDialog.curvedArrow")}- shortcuts={[- "A",- t("helpDialog.click"),- t("helpDialog.click"),- t("helpDialog.click"),- ]}- isOr={false}- />- <Shortcut- label={t("helpDialog.curvedLine")}- shortcuts={[- "L",- t("helpDialog.click"),- t("helpDialog.click"),- t("helpDialog.click"),- ]}- isOr={false}- />- <Shortcut label={t("toolBar.lock")} shortcuts={["Q"]} />- <Shortcut- label={t("helpDialog.preventBinding")}- shortcuts={[getShortcutKey("CtrlOrCmd")]}- />- <Shortcut- label={t("toolBar.link")}- shortcuts={[getShortcutKey("CtrlOrCmd+K")]}- />- </ShortcutIsland>- <ShortcutIsland caption={t("helpDialog.view")}>- <Shortcut- label={t("buttons.zoomIn")}- shortcuts={[getShortcutKey("CtrlOrCmd++")]}- />- <Shortcut- label={t("buttons.zoomOut")}- shortcuts={[getShortcutKey("CtrlOrCmd+-")]}- />- <Shortcut- label={t("buttons.resetZoom")}- shortcuts={[getShortcutKey("CtrlOrCmd+0")]}- />- <Shortcut- label={t("helpDialog.zoomToFit")}- shortcuts={["Shift+1"]}- />- <Shortcut- label={t("helpDialog.zoomToSelection")}- shortcuts={["Shift+2"]}- />- <Shortcut label={t("buttons.fullScreen")} shortcuts={["F"]} />- <Shortcut- label={t("buttons.zenMode")}- shortcuts={[getShortcutKey("Alt+Z")]}- />- <Shortcut- label={t("labels.showGrid")}- shortcuts={[getShortcutKey("CtrlOrCmd+'")]}- />- <Shortcut- label={t("labels.viewMode")}- shortcuts={[getShortcutKey("Alt+R")]}- />- <Shortcut- label={t("labels.toggleTheme")}- shortcuts={[getShortcutKey("Alt+Shift+D")]}- />- <Shortcut- label={t("stats.title")}- shortcuts={[getShortcutKey("Alt+/")]}- />- </ShortcutIsland>- </Column>- <Column>- <ShortcutIsland caption={t("helpDialog.editor")}>- <Shortcut- label={t("labels.selectAll")}- shortcuts={[getShortcutKey("CtrlOrCmd+A")]}- />- <Shortcut- label={t("labels.multiSelect")}- shortcuts={[getShortcutKey(`Shift+${t("helpDialog.click")}`)]}- />- <Shortcut- label={t("helpDialog.deepSelect")}- shortcuts={[- getShortcutKey(`CtrlOrCmd+${t("helpDialog.click")}`),- ]}- />- <Shortcut- label={t("helpDialog.deepBoxSelect")}- shortcuts={[- getShortcutKey(`CtrlOrCmd+${t("helpDialog.drag")}`),- ]}- />- <Shortcut- label={t("labels.moveCanvas")}- shortcuts={[- getShortcutKey(`Space+${t("helpDialog.drag")}`),- getShortcutKey(`Wheel+${t("helpDialog.drag")}`),- ]}- isOr={true}- />- <Shortcut- label={t("labels.cut")}- shortcuts={[getShortcutKey("CtrlOrCmd+X")]}- />- <Shortcut- label={t("labels.copy")}- shortcuts={[getShortcutKey("CtrlOrCmd+C")]}- />- <Shortcut- label={t("labels.paste")}- shortcuts={[getShortcutKey("CtrlOrCmd+V")]}- />- <Shortcut- label={t("labels.copyAsPng")}- shortcuts={[getShortcutKey("Shift+Alt+C")]}- />- <Shortcut- label={t("labels.copyStyles")}- shortcuts={[getShortcutKey("CtrlOrCmd+Alt+C")]}- />- <Shortcut- label={t("labels.pasteStyles")}- shortcuts={[getShortcutKey("CtrlOrCmd+Alt+V")]}- />- <Shortcut- label={t("labels.delete")}- shortcuts={[getShortcutKey("Del")]}- />- <Shortcut- label={t("labels.sendToBack")}- shortcuts={[- isDarwin- ? getShortcutKey("CtrlOrCmd+Alt+[")- : getShortcutKey("CtrlOrCmd+Shift+["),- ]}- />- <Shortcut- label={t("labels.bringToFront")}- shortcuts={[- isDarwin- ? getShortcutKey("CtrlOrCmd+Alt+]")- : getShortcutKey("CtrlOrCmd+Shift+]"),- ]}- />- <Shortcut- label={t("labels.sendBackward")}- shortcuts={[getShortcutKey("CtrlOrCmd+[")]}- />- <Shortcut- label={t("labels.bringForward")}- shortcuts={[getShortcutKey("CtrlOrCmd+]")]}- />- <Shortcut- label={t("labels.alignTop")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Up")]}- />- <Shortcut- label={t("labels.alignBottom")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Down")]}- />- <Shortcut- label={t("labels.alignLeft")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Left")]}- />- <Shortcut- label={t("labels.alignRight")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Right")]}- />- <Shortcut- label={t("labels.duplicateSelection")}- shortcuts={[- getShortcutKey("CtrlOrCmd+D"),- getShortcutKey(`Alt+${t("helpDialog.drag")}`),- ]}- />- <Shortcut- label={t("helpDialog.toggleElementLock")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+L")]}- />- <Shortcut- label={t("buttons.undo")}- shortcuts={[getShortcutKey("CtrlOrCmd+Z")]}- />- <Shortcut- label={t("buttons.redo")}- shortcuts={- isWindows- ? [- getShortcutKey("CtrlOrCmd+Y"),- getShortcutKey("CtrlOrCmd+Shift+Z"),- ]- : [getShortcutKey("CtrlOrCmd+Shift+Z")]- }- />- <Shortcut- label={t("labels.group")}- shortcuts={[getShortcutKey("CtrlOrCmd+G")]}- />- <Shortcut- label={t("labels.ungroup")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+G")]}- />- <Shortcut- label={t("labels.flipHorizontal")}- shortcuts={[getShortcutKey("Shift+H")]}- />- <Shortcut- label={t("labels.flipVertical")}- shortcuts={[getShortcutKey("Shift+V")]}- />- <Shortcut- label={t("labels.showStroke")}- shortcuts={[getShortcutKey("S")]}- />- <Shortcut- label={t("labels.showBackground")}- shortcuts={[getShortcutKey("G")]}- />- <Shortcut- label={t("labels.decreaseFontSize")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+<")]}- />- <Shortcut- label={t("labels.increaseFontSize")}- shortcuts={[getShortcutKey("CtrlOrCmd+Shift+>")]}- />- </ShortcutIsland>- </Column>- </Columns>+ <ShortcutIsland+ className="HelpDialog__island--tools"+ caption={t("helpDialog.tools")}+ >+ <Shortcut label={t("toolBar.selection")} shortcuts={["V", "1"]} />+ <Shortcut label={t("toolBar.rectangle")} shortcuts={["R", "2"]} />+ <Shortcut label={t("toolBar.diamond")} shortcuts={["D", "3"]} />+ <Shortcut label={t("toolBar.ellipse")} shortcuts={["O", "4"]} />+ <Shortcut label={t("toolBar.arrow")} shortcuts={["A", "5"]} />+ <Shortcut label={t("toolBar.line")} shortcuts={["P", "6"]} />+ <Shortcut+ label={t("toolBar.freedraw")}+ shortcuts={["Shift + P", "X", "7"]}+ />+ <Shortcut label={t("toolBar.text")} shortcuts={["T", "8"]} />+ <Shortcut label={t("toolBar.image")} shortcuts={["9"]} />+ <Shortcut label={t("toolBar.library")} shortcuts={["0"]} />+ <Shortcut+ label={t("toolBar.eraser")}+ shortcuts={[getShortcutKey("E")]}+ />+ <Shortcut+ label={t("helpDialog.editSelectedShape")}+ shortcuts={[getShortcutKey("Enter"), t("helpDialog.doubleClick")]}+ />+ <Shortcut+ label={t("helpDialog.textNewLine")}+ shortcuts={[+ getShortcutKey("Enter"),+ getShortcutKey("Shift+Enter"),+ ]}+ />+ <Shortcut+ label={t("helpDialog.textFinish")}+ shortcuts={[+ getShortcutKey("Esc"),+ getShortcutKey("CtrlOrCmd+Enter"),+ ]}+ />+ <Shortcut+ label={t("helpDialog.curvedArrow")}+ shortcuts={[+ "A",+ t("helpDialog.click"),+ t("helpDialog.click"),+ t("helpDialog.click"),+ ]}+ isOr={false}+ />+ <Shortcut+ label={t("helpDialog.curvedLine")}+ shortcuts={[+ "L",+ t("helpDialog.click"),+ t("helpDialog.click"),+ t("helpDialog.click"),+ ]}+ isOr={false}+ />+ <Shortcut label={t("toolBar.lock")} shortcuts={["Q"]} />+ <Shortcut+ label={t("helpDialog.preventBinding")}+ shortcuts={[getShortcutKey("CtrlOrCmd")]}+ />+ <Shortcut+ label={t("toolBar.link")}+ shortcuts={[getShortcutKey("CtrlOrCmd+K")]}+ />+ </ShortcutIsland>+ <ShortcutIsland+ className="HelpDialog__island--view"+ caption={t("helpDialog.view")}+ >+ <Shortcut+ label={t("buttons.zoomIn")}+ shortcuts={[getShortcutKey("CtrlOrCmd++")]}+ />+ <Shortcut+ label={t("buttons.zoomOut")}+ shortcuts={[getShortcutKey("CtrlOrCmd+-")]}+ />+ <Shortcut+ label={t("buttons.resetZoom")}+ shortcuts={[getShortcutKey("CtrlOrCmd+0")]}+ />+ <Shortcut+ label={t("helpDialog.zoomToFit")}+ shortcuts={["Shift+1"]}+ />+ <Shortcut+ label={t("helpDialog.zoomToSelection")}+ shortcuts={["Shift+2"]}+ />+ <Shortcut label={t("buttons.fullScreen")} shortcuts={["F"]} />+ <Shortcut+ label={t("buttons.zenMode")}+ shortcuts={[getShortcutKey("Alt+Z")]}+ />+ <Shortcut+ label={t("labels.showGrid")}+ shortcuts={[getShortcutKey("CtrlOrCmd+'")]}+ />+ <Shortcut+ label={t("labels.viewMode")}+ shortcuts={[getShortcutKey("Alt+R")]}+ />+ <Shortcut+ label={t("labels.toggleTheme")}+ shortcuts={[getShortcutKey("Alt+Shift+D")]}+ />+ <Shortcut+ label={t("stats.title")}+ shortcuts={[getShortcutKey("Alt+/")]}+ />+ </ShortcutIsland>+ <ShortcutIsland+ className="HelpDialog__island--editor"+ caption={t("helpDialog.editor")}+ >+ <Shortcut+ label={t("labels.selectAll")}+ shortcuts={[getShortcutKey("CtrlOrCmd+A")]}+ />+ <Shortcut+ label={t("labels.multiSelect")}+ shortcuts={[getShortcutKey(`Shift+${t("helpDialog.click")}`)]}+ />+ <Shortcut+ label={t("helpDialog.deepSelect")}+ shortcuts={[getShortcutKey(`CtrlOrCmd+${t("helpDialog.click")}`)]}+ />+ <Shortcut+ label={t("helpDialog.deepBoxSelect")}+ shortcuts={[getShortcutKey(`CtrlOrCmd+${t("helpDialog.drag")}`)]}+ />+ <Shortcut+ label={t("labels.moveCanvas")}+ shortcuts={[+ getShortcutKey(`Space+${t("helpDialog.drag")}`),+ getShortcutKey(`Wheel+${t("helpDialog.drag")}`),+ ]}+ isOr={true}+ />+ <Shortcut+ label={t("labels.cut")}+ shortcuts={[getShortcutKey("CtrlOrCmd+X")]}+ />+ <Shortcut+ label={t("labels.copy")}+ shortcuts={[getShortcutKey("CtrlOrCmd+C")]}+ />+ <Shortcut+ label={t("labels.paste")}+ shortcuts={[getShortcutKey("CtrlOrCmd+V")]}+ />+ <Shortcut+ label={t("labels.copyAsPng")}+ shortcuts={[getShortcutKey("Shift+Alt+C")]}+ />+ <Shortcut+ label={t("labels.copyStyles")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Alt+C")]}+ />+ <Shortcut+ label={t("labels.pasteStyles")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Alt+V")]}+ />+ <Shortcut+ label={t("labels.delete")}+ shortcuts={[getShortcutKey("Del")]}+ />+ <Shortcut+ label={t("labels.sendToBack")}+ shortcuts={[+ isDarwin+ ? getShortcutKey("CtrlOrCmd+Alt+[")+ : getShortcutKey("CtrlOrCmd+Shift+["),+ ]}+ />+ <Shortcut+ label={t("labels.bringToFront")}+ shortcuts={[+ isDarwin+ ? getShortcutKey("CtrlOrCmd+Alt+]")+ : getShortcutKey("CtrlOrCmd+Shift+]"),+ ]}+ />+ <Shortcut+ label={t("labels.sendBackward")}+ shortcuts={[getShortcutKey("CtrlOrCmd+[")]}+ />+ <Shortcut+ label={t("labels.bringForward")}+ shortcuts={[getShortcutKey("CtrlOrCmd+]")]}+ />+ <Shortcut+ label={t("labels.alignTop")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Up")]}+ />+ <Shortcut+ label={t("labels.alignBottom")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Down")]}+ />+ <Shortcut+ label={t("labels.alignLeft")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Left")]}+ />+ <Shortcut+ label={t("labels.alignRight")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+Right")]}+ />+ <Shortcut+ label={t("labels.duplicateSelection")}+ shortcuts={[+ getShortcutKey("CtrlOrCmd+D"),+ getShortcutKey(`Alt+${t("helpDialog.drag")}`),+ ]}+ />+ <Shortcut+ label={t("helpDialog.toggleElementLock")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+L")]}+ />+ <Shortcut+ label={t("buttons.undo")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Z")]}+ />+ <Shortcut+ label={t("buttons.redo")}+ shortcuts={+ isWindows+ ? [+ getShortcutKey("CtrlOrCmd+Y"),+ getShortcutKey("CtrlOrCmd+Shift+Z"),+ ]+ : [getShortcutKey("CtrlOrCmd+Shift+Z")]+ }+ />+ <Shortcut+ label={t("labels.group")}+ shortcuts={[getShortcutKey("CtrlOrCmd+G")]}+ />+ <Shortcut+ label={t("labels.ungroup")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+G")]}+ />+ <Shortcut+ label={t("labels.flipHorizontal")}+ shortcuts={[getShortcutKey("Shift+H")]}+ />+ <Shortcut+ label={t("labels.flipVertical")}+ shortcuts={[getShortcutKey("Shift+V")]}+ />+ <Shortcut+ label={t("labels.showStroke")}+ shortcuts={[getShortcutKey("S")]}+ />+ <Shortcut+ label={t("labels.showBackground")}+ shortcuts={[getShortcutKey("G")]}+ />+ <Shortcut+ label={t("labels.decreaseFontSize")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+<")]}+ />+ <Shortcut+ label={t("labels.increaseFontSize")}+ shortcuts={[getShortcutKey("CtrlOrCmd+Shift+>")]}+ />+ </ShortcutIsland></Section></Dialog></>diff --git a/src/components/HintViewer.scss b/src/components/HintViewer.scssindex 2e3a15bff3..fdbbd0fe60 100644--- a/src/components/HintViewer.scss+++ b/src/components/HintViewer.scss@@ -14,20 +14,24 @@ $wide-viewport-width: 1000px;top: 100%;max-width: 100%;width: 100%;- margin-top: 6px;+ margin-top: 0.5rem;text-align: center;- color: $oc-gray-6;- font-size: 0.8rem;+ color: var(--color-gray-40);+ font-size: 0.75rem;@include isMobile {position: static;- padding-right: 2em;+ padding-right: 2rem;}> span {- padding: 0.2rem 0.4rem;- background-color: var(--overlay-bg-color);- border-radius: 4px;+ padding: 0.25rem;+ }+ }++ &.theme--dark {+ .HintViewer {+ color: var(--color-gray-60);}}}diff --git a/src/components/IconPicker.scss b/src/components/IconPicker.scssindex 5d0857f491..23ec7c36cb 100644--- a/src/components/IconPicker.scss+++ b/src/components/IconPicker.scss@@ -10,7 +10,8 @@.picker {background: var(--popup-bg-color);border: 0 solid transparentize($oc-white, 0.75);- box-shadow: transparentize($oc-black, 0.75) 0 1px 4px;+ // ˇˇ yeah, i dunno, open to suggestions here :D+ box-shadow: rgb(0 0 0 / 25%) 2px 2px 4px 2px;border-radius: 4px;position: absolute;}@@ -46,7 +47,6 @@margin: 0;width: 36px;height: 18px;- opacity: 0.6;pointer-events: none;}}diff --git a/src/components/IconPicker.tsx b/src/components/IconPicker.tsxindex 9b6d7ea5c5..30b8a97b14 100644--- a/src/components/IconPicker.tsx+++ b/src/components/IconPicker.tsx@@ -4,6 +4,7 @@ import { Popover } from "./Popover";import "./IconPicker.scss";import { isArrowKey, KEYS } from "../keys";import { getLanguage } from "../i18n";+import clsx from "clsx";function Picker<T>({options,@@ -102,7 +103,9 @@ function Picker<T>({<div className="picker-content" ref={rGallery}>{options.map((option, i) => (<button- className="picker-option"+ className={clsx("picker-option", {+ active: value === option.value,+ })}onClick={(event) => {(event.currentTarget as HTMLButtonElement).focus();onChange(option.value);@@ -150,7 +153,7 @@ export function IconPicker<T>({const isRTL = getLanguage().rtl;return (- <label className={"picker-container"}>+ <div><buttonname={group}className={isActive ? "active" : ""}@@ -184,6 +187,6 @@ export function IconPicker<T>({</>) : null}</React.Suspense>- </label>+ </div>);}diff --git a/src/components/ImageExportDialog.tsx b/src/components/ImageExportDialog.tsxindex 8a8b7038f9..2a1e05926d 100644--- a/src/components/ImageExportDialog.tsx+++ b/src/components/ImageExportDialog.tsx@@ -5,14 +5,12 @@ import { canvasToBlob } from "../data/blob";import { NonDeletedExcalidrawElement } from "../element/types";import { CanvasError } from "../errors";import { t } from "../i18n";-import { useDevice } from "./App";import { getSelectedElements, isSomeElementSelected } from "../scene";import { exportToCanvas } from "../scene/export";import { AppState, BinaryFiles } from "../types";import { Dialog } from "./Dialog";-import { clipboard, exportImage } from "./icons";+import { clipboard } from "./icons";import Stack from "./Stack";-import { ToolButton } from "./ToolButton";import "./ExportDialog.scss";import OpenColor from "open-color";import { CheckboxItem } from "./CheckboxItem";@@ -221,6 +219,7 @@ const ImageExportModal = ({export const ImageExportDialog = ({elements,appState,+ setAppState,files,exportPadding = DEFAULT_EXPORT_PADDING,actionManager,@@ -229,6 +228,7 @@ export const ImageExportDialog = ({onExportToClipboard,}: {appState: AppState;+ setAppState: React.Component<any, AppState>["setState"];elements: readonly NonDeletedExcalidrawElement[];files: BinaryFiles;exportPadding?: number;@@ -237,26 +237,13 @@ export const ImageExportDialog = ({onExportToSvg: ExportCB;onExportToClipboard: ExportCB;}) => {- const [modalIsShown, setModalIsShown] = useState(false);-const handleClose = React.useCallback(() => {- setModalIsShown(false);- }, []);+ setAppState({ openDialog: null });+ }, [setAppState]);return (<>- <ToolButton- onClick={() => {- setModalIsShown(true);- }}- data-testid="image-export-button"- icon={exportImage}- type="button"- aria-label={t("buttons.exportImage")}- showAriaLabel={useDevice().isMobile}- title={t("buttons.exportImage")}- />- {modalIsShown && (+ {appState.openDialog === "imageExport" && (<Dialog onCloseRequest={handleClose} title={t("buttons.exportImage")}><ImageExportModalelements={elements}diff --git a/src/components/Island.scss b/src/components/Island.scssindex 499d13ad3d..e9f8ebef56 100644--- a/src/components/Island.scss+++ b/src/components/Island.scss@@ -1,6 +1,7 @@.excalidraw {.Island {--padding: 0;+ box-sizing: border-box;background-color: var(--island-bg-color);box-shadow: var(--shadow-island);border-radius: var(--border-radius-lg);diff --git a/src/components/JSONExportDialog.tsx b/src/components/JSONExportDialog.tsxindex 98e0519f37..11e52ac0cf 100644--- a/src/components/JSONExportDialog.tsx+++ b/src/components/JSONExportDialog.tsx@@ -1,10 +1,10 @@import React, { useState } from "react";import { NonDeletedExcalidrawElement } from "../element/types";import { t } from "../i18n";-import { useDevice } from "./App";+import { AppState, ExportOpts, BinaryFiles } from "../types";import { Dialog } from "./Dialog";-import { exportFile, exportToFileIcon, link } from "./icons";+import { ExportIcon, exportToFileIcon, LinkIcon } from "./icons";import { ToolButton } from "./ToolButton";import { actionSaveFileToDisk } from "../actions/actionExport";import { Card } from "./Card";@@ -14,6 +14,7 @@ import { nativeFileSystemSupported } from "../data/filesystem";import { trackEvent } from "../analytics";import { ActionManager } from "../actions/manager";import { getFrame } from "../utils";+import MenuItem from "./MenuItem";export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[],@@ -63,7 +64,7 @@ const JSONExportModal = ({)}{onExportToBackend && (<Card color="pink">- <div className="Card-icon">{link}</div>+ <div className="Card-icon">{LinkIcon}</div><h2>{t("exportDialog.link_title")}</h2><div className="Card-details">{t("exportDialog.link_details")}</div><ToolButton@@ -109,16 +110,13 @@ export const JSONExportDialog = ({return (<>- <ToolButton+ <MenuItem+ icon={ExportIcon}+ label={t("buttons.export")}onClick={() => {setModalIsShown(true);}}- data-testid="json-export-button"- icon={exportFile}- type="button"- aria-label={t("buttons.export")}- showAriaLabel={useDevice().isMobile}- title={t("buttons.export")}+ dataTestId="json-export-button"/>{modalIsShown && (<Dialog onCloseRequest={handleClose} title={t("buttons.export")}>diff --git a/src/components/LayerUI.scss b/src/components/LayerUI.scssindex 192233904b..c1d3eb89e9 100644--- a/src/components/LayerUI.scss+++ b/src/components/LayerUI.scss@@ -16,8 +16,10 @@height: 100%;pointer-events: none;z-index: var(--zIndex-layerUI);+&__top-right {display: flex;+ gap: 0.75rem;}&__footer {@@ -48,13 +50,6 @@transform: translate(-999px, 0);}- :root[dir="ltr"] &.layer-ui__wrapper__footer-left--transition-left {- transform: translate(-76px, 0);- }- :root[dir="rtl"] &.layer-ui__wrapper__footer-left--transition-left {- transform: translate(76px, 0);- }-&.layer-ui__wrapper__footer-left--transition-bottom {transform: translate(0, 92px);}@@ -97,14 +92,9 @@pointer-events: all;}- .layer-ui__wrapper__footer-left {- margin-bottom: 0.2em;- }-.layer-ui__wrapper__footer-right {margin-top: auto;margin-bottom: auto;- margin-inline-end: 1em;}}}diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsxindex b5c94154cc..a447ed2ab5 100644--- a/src/components/LayerUI.tsx+++ b/src/components/LayerUI.tsx@@ -11,7 +11,6 @@ import { ExportType } from "../scene/types";import { AppProps, AppState, ExcalidrawProps, BinaryFiles } from "../types";import { muteFSAbortError } from "../utils";import { SelectedShapeActions, ShapesSwitcher } from "./Actions";-import { BackgroundPickerAndDarkModeToggle } from "./BackgroundPickerAndDarkModeToggle";import CollabButton from "./CollabButton";import { ErrorDialog } from "./ErrorDialog";import { ExportCB, ImageExportDialog } from "./ImageExportDialog";@@ -36,13 +35,26 @@ import "./LayerUI.scss";import "./Toolbar.scss";import { PenModeButton } from "./PenModeButton";import { trackEvent } from "../analytics";-import { useDevice } from "../components/App";+import { isMenuOpenAtom, useDevice } from "../components/App";import { Stats } from "./Stats";import { actionToggleStats } from "../actions/actionToggleStats";import Footer from "./Footer";+import {+ ExportImageIcon,+ HamburgerMenuIcon,+ WelcomeScreenMenuArrow,+ WelcomeScreenTopToolbarArrow,+} from "./icons";+import { MenuLinks, Separator } from "./MenuUtils";+import { useOutsideClickHook } from "../hooks/useOutsideClick";+import WelcomeScreen from "./WelcomeScreen";import { hostSidebarCountersAtom } from "./Sidebar/Sidebar";import { jotaiScope } from "../jotai";import { useAtom } from "jotai";+import { LanguageList } from "../excalidraw-app/components/LanguageList";+import WelcomeScreenDecor from "./WelcomeScreenDecor";+import { getShortcutFromShortcutName } from "../actions/shortcuts";+import MenuItem from "./MenuItem";interface LayerUIProps {actionManager: ActionManager;@@ -68,6 +80,7 @@ interface LayerUIProps {library: Library;id: string;onImageAction: (data: { insertOnCanvasDirectly: boolean }) => void;+ renderWelcomeScreen: boolean;}const LayerUI = ({actionManager,@@ -92,6 +105,7 @@ const LayerUI = ({library,id,onImageAction,+ renderWelcomeScreen,}: LayerUIProps) => {const device = useDevice();@@ -151,6 +165,7 @@ const LayerUI = ({<ImageExportDialogelements={elements}appState={appState}+ setAppState={setAppState}files={files}actionManager={actionManager}onExportToPng={createExporter("png")}@@ -160,71 +175,100 @@ const LayerUI = ({);};- const Separator = () => {- return <div style={{ width: ".625em" }} />;- };+ const [isMenuOpen, setIsMenuOpen] = useAtom(isMenuOpenAtom);+ const menuRef = useOutsideClickHook(() => setIsMenuOpen(false));- const renderViewModeCanvasActions = () => {- return (- <Section- heading="canvasActions"- className={clsx("zen-mode-transition", {+ const renderCanvasActions = () => (+ <div style={{ position: "relative" }}>+ <WelcomeScreenDecor+ shouldRender={renderWelcomeScreen && !appState.isLoading}+ >+ <div className="virgil WelcomeScreen-decor WelcomeScreen-decor--menu-pointer">+ {WelcomeScreenMenuArrow}+ <div>{t("welcomeScreen.menuHints")}</div>+ </div>+ </WelcomeScreenDecor>++ <button+ data-prevent-outside-click+ className={clsx("menu-button", "zen-mode-transition", {"transition-left": appState.zenModeEnabled,})}+ onClick={() => setIsMenuOpen(!isMenuOpen)}+ type="button">- {/* the zIndex ensures this menu has higher stacking order,- see https://github.com/excalidraw/excalidraw/pull/1445 */}- <Island padding={2} style={{ zIndex: 1 }}>- <Stack.Col gap={4}>- <Stack.Row gap={1} justifyContent="space-between">- {renderJSONExportDialog()}- {renderImageExportDialog()}- </Stack.Row>- </Stack.Col>- </Island>- </Section>- );- };+ {HamburgerMenuIcon}+ </button>- const renderCanvasActions = () => (- <Section- heading="canvasActions"- className={clsx("zen-mode-transition", {- "transition-left": appState.zenModeEnabled,- })}- >- {/* the zIndex ensures this menu has higher stacking order,+ {isMenuOpen && (+ <div+ ref={menuRef}+ style={{ position: "absolute", top: "100%", marginTop: ".25rem" }}+ >+ <Section heading="canvasActions">+ {/* the zIndex ensures this menu has higher stacking order,see https://github.com/excalidraw/excalidraw/pull/1445 */}- <Island padding={2} style={{ zIndex: 1 }}>- <Stack.Col gap={4}>- <Stack.Row gap={1} justifyContent="space-between">- {actionManager.renderAction("clearCanvas")}- <Separator />- {actionManager.renderAction("loadScene")}- {renderJSONExportDialog()}- {renderImageExportDialog()}- <Separator />- {onCollabButtonClick && (- <CollabButton- isCollaborating={isCollaborating}- collaboratorCount={appState.collaborators.size}- onClick={onCollabButtonClick}+ <Island+ className="menu-container"+ padding={2}+ style={{ zIndex: 1 }}+ >+ {actionManager.renderAction("loadScene")}+ {/* // TODO barnabasmolnar/editor-redesign */}+ {/* is this fine here? */}+ {appState.fileHandle &&+ actionManager.renderAction("saveToActiveFile")}+ {renderJSONExportDialog()}+ <MenuItem+ label={t("buttons.exportImage")}+ icon={ExportImageIcon}+ dataTestId="image-export-button"+ onClick={() => setAppState({ openDialog: "imageExport" })}+ shortcut={getShortcutFromShortcutName("imageExport")}/>- )}- </Stack.Row>- <BackgroundPickerAndDarkModeToggle actionManager={actionManager} />- {appState.fileHandle && (- <>{actionManager.renderAction("saveToActiveFile")}</>- )}- </Stack.Col>- </Island>- </Section>+ {onCollabButtonClick && (+ <CollabButton+ isCollaborating={isCollaborating}+ collaboratorCount={appState.collaborators.size}+ onClick={onCollabButtonClick}+ />+ )}+ {actionManager.renderAction("toggleShortcuts", undefined, true)}+ {actionManager.renderAction("clearCanvas")}+ <Separator />+ <MenuLinks />+ <Separator />+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ rowGap: ".5rem",+ }}+ >+ <div>{actionManager.renderAction("toggleTheme")}</div>+ <div style={{ padding: "0 0.625rem" }}>+ <LanguageList style={{ width: "100%" }} />+ </div>+ <div>+ <div style={{ fontSize: ".75rem", marginBottom: ".5rem" }}>+ {t("labels.canvasBackground")}+ </div>+ <div style={{ padding: "0 0.625rem" }}>+ {actionManager.renderAction("changeViewBackgroundColor")}+ </div>+ </div>+ </div>+ </Island>+ </Section>+ </div>+ )}+ </div>);const renderSelectedShapeActions = () => (<Sectionheading="selectedShapeActions"- className={clsx("zen-mode-transition", {+ className={clsx("selected-shape-actions zen-mode-transition", {"transition-left": appState.zenModeEnabled,})}>@@ -232,10 +276,9 @@ const LayerUI = ({className={CLASSES.SHAPE_ACTIONS_MENU}padding={2}style={{- // we want to make sure this doesn't overflow so subtracting 200- // which is approximately height of zoom footer and top left menu items with some buffer- // if active file name is displayed, subtracting 248 to account for its height- maxHeight: `${appState.height - (appState.fileHandle ? 248 : 200)}px`,+ // we want to make sure this doesn't overflow so subtracting the+ // approximate height of hamburgerMenu + footer+ maxHeight: `${appState.height - 166}px`,}}><SelectedShapeActions@@ -255,74 +298,89 @@ const LayerUI = ({return (<FixedSideContainer side="top">+ {renderWelcomeScreen && !appState.isLoading && (+ <WelcomeScreen actionManager={actionManager} />+ )}<div className="App-menu App-menu_top"><Stack.Col- gap={4}+ gap={6}className={clsx({"disable-pointerEvents": appState.zenModeEnabled,})}>- {appState.viewModeEnabled- ? renderViewModeCanvasActions()- : renderCanvasActions()}+ {renderCanvasActions()}{shouldRenderSelectedShapeActions && renderSelectedShapeActions()}</Stack.Col>{!appState.viewModeEnabled && (- <Section heading="shapes">+ <Section heading="shapes" className="shapes-section">{(heading: React.ReactNode) => (- <Stack.Col gap={4} align="start">- <Stack.Row- gap={1}- className={clsx("App-toolbar-container", {- "zen-mode": appState.zenModeEnabled,- })}+ <div style={{ position: "relative" }}>+ <WelcomeScreenDecor+ shouldRender={renderWelcomeScreen && !appState.isLoading}>- <PenModeButton- zenModeEnabled={appState.zenModeEnabled}- checked={appState.penMode}- onChange={onPenModeToggle}- title={t("toolBar.penMode")}- penDetected={appState.penDetected}- />- <LockButton- zenModeEnabled={appState.zenModeEnabled}- checked={appState.activeTool.locked}- onChange={() => onLockToggle()}- title={t("toolBar.lock")}- />- <Island- padding={1}- className={clsx("App-toolbar", {+ <div className="virgil WelcomeScreen-decor WelcomeScreen-decor--top-toolbar-pointer">+ <div className="WelcomeScreen-decor--top-toolbar-pointer__label">+ {t("welcomeScreen.toolbarHints")}+ </div>+ {WelcomeScreenTopToolbarArrow}+ </div>+ </WelcomeScreenDecor>++ <Stack.Col gap={4} align="start">+ <Stack.Row+ gap={1}+ className={clsx("App-toolbar-container", {"zen-mode": appState.zenModeEnabled,})}>- <HintViewer- appState={appState}- elements={elements}- isMobile={device.isMobile}- device={device}- />- {heading}- <Stack.Row gap={1}>- <ShapesSwitcher+ <Island+ padding={1}+ className={clsx("App-toolbar", {+ "zen-mode": appState.zenModeEnabled,+ })}+ >+ <HintViewerappState={appState}- canvas={canvas}- activeTool={appState.activeTool}- setAppState={setAppState}- onImageAction={({ pointerType }) => {- onImageAction({- insertOnCanvasDirectly: pointerType !== "mouse",- });- }}+ elements={elements}+ isMobile={device.isMobile}+ device={device}/>- </Stack.Row>- </Island>- <LibraryButton- appState={appState}- setAppState={setAppState}- />- </Stack.Row>- </Stack.Col>+ {heading}+ <Stack.Row gap={1}>+ <PenModeButton+ zenModeEnabled={appState.zenModeEnabled}+ checked={appState.penMode}+ onChange={onPenModeToggle}+ title={t("toolBar.penMode")}+ penDetected={appState.penDetected}+ />+ <LockButton+ zenModeEnabled={appState.zenModeEnabled}+ checked={appState.activeTool.locked}+ onChange={() => onLockToggle()}+ title={t("toolBar.lock")}+ />+ <div className="App-toolbar__divider"></div>++ <ShapesSwitcher+ appState={appState}+ canvas={canvas}+ activeTool={appState.activeTool}+ setAppState={setAppState}+ onImageAction={({ pointerType }) => {+ onImageAction({+ insertOnCanvasDirectly: pointerType !== "mouse",+ });+ }}+ />+ {/* {actionManager.renderAction("eraser", {+ // size: "small",+ })} */}+ </Stack.Row>+ </Island>+ </Stack.Row>+ </Stack.Col>+ </div>)}</Section>)}@@ -338,7 +396,16 @@ const LayerUI = ({collaborators={appState.collaborators}actionManager={actionManager}/>+ {onCollabButtonClick && (+ <CollabButton+ isInHamburgerMenu={false}+ isCollaborating={isCollaborating}+ collaboratorCount={appState.collaborators.size}+ onClick={onCollabButtonClick}+ />+ )}{renderTopRightUI?.(device.isMobile, appState)}+ <LibraryButton appState={appState} setAppState={setAppState} /></div></div></FixedSideContainer>@@ -371,13 +438,14 @@ const LayerUI = ({onClose={() => setAppState({ errorMessage: null })}/>)}- {appState.showHelpDialog && (+ {appState.openDialog === "help" && (<HelpDialogonClose={() => {- setAppState({ showHelpDialog: false });+ setAppState({ openDialog: null });}}/>)}+ {renderImageExportDialog()}{appState.pasteDialog.shown && (<PasteChartDialogsetAppState={setAppState}@@ -392,6 +460,7 @@ const LayerUI = ({)}{device.isMobile && (<MobileMenu+ renderWelcomeScreen={renderWelcomeScreen}appState={appState}elements={elements}actionManager={actionManager}@@ -433,6 +502,7 @@ const LayerUI = ({>{renderFixedSideContainer()}<Footer+ renderWelcomeScreen={renderWelcomeScreen}appState={appState}actionManager={actionManager}renderCustomFooter={renderCustomFooter}diff --git a/src/components/LibraryButton.scss b/src/components/LibraryButton.scssnew file mode 100644index 0000000000..1a3db79f39--- /dev/null+++ b/src/components/LibraryButton.scss@@ -0,0 +1,32 @@+@import "../css/variables.module";++.library-button {+ @include outlineButtonStyles;++ background-color: var(--island-bg-color);++ width: auto;+ height: var(--lg-button-size);++ display: flex;+ align-items: center;+ gap: 0.5rem;++ line-height: 0;++ font-size: 0.75rem;+ letter-spacing: 0.4px;++ svg {+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);+ }++ &__label {+ display: none;++ @media screen and (min-width: 1024px) {+ display: block;+ }+ }+}diff --git a/src/components/LibraryButton.tsx b/src/components/LibraryButton.tsxindex 98fcabf62d..ef18e337d4 100644--- a/src/components/LibraryButton.tsx+++ b/src/components/LibraryButton.tsx@@ -1,19 +1,11 @@import React from "react";-import clsx from "clsx";import { t } from "../i18n";import { AppState } from "../types";import { capitalizeString } from "../utils";import { trackEvent } from "../analytics";import { useDevice } from "./App";--const LIBRARY_ICON = (- <svg viewBox="0 0 576 512">- <path- fill="currentColor"- d="M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"- ></path>- </svg>-);+import "./LibraryButton.scss";+import { LibraryIcon } from "./icons";export const LibraryButton: React.FC<{appState: AppState;@@ -21,17 +13,16 @@ export const LibraryButton: React.FC<{isMobile?: boolean;}> = ({ appState, setAppState, isMobile }) => {const device = useDevice();+ const showLabel = !isMobile;++ // TODO barnabasmolnar/redesign+ // not great, toolbar jumps in a jarring manner+ if (appState.isSidebarDocked && appState.openSidebar === "library") {+ return null;+ }+return (- <label- className={clsx(- "ToolIcon ToolIcon_type_floating ToolIcon__library",- `ToolIcon_size_medium`,- {- "is-mobile": isMobile,- },- )}- title={`${capitalizeString(t("toolBar.library"))} — 0`}- >+ <label title={`${capitalizeString(t("toolBar.library"))} — 0`}><inputclassName="ToolIcon_type_checkbox"type="checkbox"@@ -55,7 +46,12 @@ export const LibraryButton: React.FC<{aria-label={capitalizeString(t("toolBar.library"))}aria-keyshortcuts="0"/>- <div className="ToolIcon__icon">{LIBRARY_ICON}</div>+ <div className="library-button">+ <div>{LibraryIcon}</div>+ {showLabel && (+ <div className="library-button__label">{t("toolBar.library")}</div>+ )}+ </div></label>);};diff --git a/src/components/LibraryMenu.scss b/src/components/LibraryMenu.scssindex c76a80464c..92b85687ce 100644--- a/src/components/LibraryMenu.scss+++ b/src/components/LibraryMenu.scss@@ -35,103 +35,32 @@}}- .library-actions {- width: 100%;+ .library-actions-counter {+ background-color: var(--color-primary);+ color: var(--color-primary-light);+ font-weight: bold;display: flex;- margin-right: auto;align-items: center;-- button .library-actions-counter {- position: absolute;- right: 2px;- bottom: 2px;- border-radius: 50%;- width: 1em;- height: 1em;- padding: 1px;- font-size: 0.7rem;- background: #fff;- }-- &--remove {- background-color: $oc-red-7;- &:hover {- background-color: $oc-red-8;- }- &:active {- background-color: $oc-red-9;- }- svg {- color: $oc-white;- }- .library-actions-counter {- color: $oc-red-7;- }- }-- &--export {- background-color: $oc-lime-5;-- &:hover {- background-color: $oc-lime-7;- }-- &:active {- background-color: $oc-lime-8;- }- svg {- color: $oc-white;- }- .library-actions-counter {- color: $oc-lime-5;- }- }-- &--publish {- background-color: $oc-cyan-6;- &:hover {- background-color: $oc-cyan-7;- }- &:active {- background-color: $oc-cyan-9;- }- svg {- color: $oc-white;- }- label {- margin-left: -0.2em;- margin-right: 1.1em;- color: $oc-white;- font-size: 0.86em;- }- .library-actions-counter {- color: $oc-cyan-6;- }- }-- &--load {- background-color: $oc-blue-6;- &:hover {- background-color: $oc-blue-7;- }- &:active {- background-color: $oc-blue-9;- }- svg {- color: $oc-white;- }- }+ justify-content: center;+ border-radius: 50%;+ width: 1rem;+ height: 1rem;+ position: absolute;+ bottom: -0.25rem;+ right: -0.25rem;+ font-size: 0.625rem;+ pointer-events: none;}.layer-ui__library-message {- padding: 2em 4em;+ padding: 2rem;min-width: 200px;display: flex;flex-direction: column;align-items: center;- .Spinner {- margin-bottom: 1em;- }+ flex-grow: 1;+ justify-content: center;+span {font-size: 0.8em;}@@ -159,11 +88,10 @@}.library-menu-browse-button {- width: 80%;- min-height: 22px;- margin: 0 auto;- margin-top: 1rem;- padding: 10px;+ margin: 1rem auto;++ padding: 0.875rem 1rem;+display: flex;align-items: center;justify-content: center;@@ -176,6 +104,10 @@text-align: center;white-space: nowrap;text-decoration: none !important;++ font-weight: 600;+ font-size: 0.75rem;+&:hover {background-color: var(--color-primary-darker);}@@ -184,6 +116,12 @@}}+ &.theme--dark {+ .library-menu-browse-button {+ color: var(--color-gray-100);+ }+ }+.library-menu-browse-button--mobile {min-height: 22px;margin-left: auto;diff --git a/src/components/LibraryMenu.tsx b/src/components/LibraryMenu.tsxindex 692ade6404..d3a7183225 100644--- a/src/components/LibraryMenu.tsx+++ b/src/components/LibraryMenu.tsx@@ -16,7 +16,7 @@ import { LibraryItems, LibraryItem, AppState, ExcalidrawProps } from "../types";import "./LibraryMenu.scss";import LibraryMenuItems from "./LibraryMenuItems";-import { EVENT, VERSIONS } from "../constants";+import { EVENT } from "../constants";import { KEYS } from "../keys";import { trackEvent } from "../analytics";import { useAtom } from "jotai";@@ -31,6 +31,7 @@ import { Sidebar } from "./Sidebar/Sidebar";import { getSelectedElements } from "../scene";import { NonDeletedExcalidrawElement } from "../element/types";import { LibraryMenuHeader } from "./LibraryMenuHeaderContent";+import LibraryMenuBrowseButton from "./LibraryMenuBrowseButton";const useOnClickOutside = (ref: RefObject<HTMLElement>,@@ -94,9 +95,6 @@ export const LibraryMenuContent = ({selectedItems: LibraryItem["id"][];onSelectItems: (id: LibraryItem["id"][]) => void;}) => {- const referrer =- libraryReturnUrl || window.location.origin + window.location.pathname;-const [libraryItemsData] = useAtom(libraryItemsAtom, jotaiScope);const addToLibrary = useCallback(@@ -131,13 +129,18 @@ export const LibraryMenuContent = ({return (<LibraryMenuWrapper><div className="layer-ui__library-message">- <Spinner size="2em" />- <span>{t("labels.libraryLoadingMessage")}</span>+ <div>+ <Spinner size="2em" />+ <span>{t("labels.libraryLoadingMessage")}</span>+ </div></div></LibraryMenuWrapper>);}+ const showBtn =+ libraryItemsData.libraryItems.length > 0 || pendingElements.length > 0;+return (<LibraryMenuWrapper><LibraryMenuItems@@ -150,18 +153,17 @@ export const LibraryMenuContent = ({pendingElements={pendingElements}selectedItems={selectedItems}onSelectItems={onSelectItems}+ id={id}+ libraryReturnUrl={libraryReturnUrl}+ theme={appState.theme}/>- <a- className="library-menu-browse-button"- href={`${process.env.REACT_APP_LIBRARY_URL}?target=${- window.name || "_blank"- }&referrer=${referrer}&useHash=true&token=${id}&theme=${- appState.theme- }&version=${VERSIONS.excalidrawLibrary}`}- target="_excalidraw_libraries"- >- {t("labels.libraries")}- </a>+ {showBtn && (+ <LibraryMenuBrowseButton+ id={id}+ libraryReturnUrl={libraryReturnUrl}+ theme={appState.theme}+ />+ )}</LibraryMenuWrapper>);};@@ -265,6 +267,7 @@ export const LibraryMenu: React.FC<{// is colled correctlykey="library"className="layer-ui__library-sidebar"+ initialDockedState={appState.isSidebarDocked}onDock={(docked) => {trackEvent("library",diff --git a/src/components/LibraryMenuBrowseButton.tsx b/src/components/LibraryMenuBrowseButton.tsxnew file mode 100644index 0000000000..69e1a69409--- /dev/null+++ b/src/components/LibraryMenuBrowseButton.tsx@@ -0,0 +1,31 @@+import { VERSIONS } from "../constants";+import { t } from "../i18n";+import { AppState, ExcalidrawProps } from "../types";++const LibraryMenuBrowseButton = ({+ theme,+ id,+ libraryReturnUrl,+}: {+ libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];+ theme: AppState["theme"];+ id: string;+}) => {+ const referrer =+ libraryReturnUrl || window.location.origin + window.location.pathname;+ return (+ <a+ className="library-menu-browse-button"+ href={`${process.env.REACT_APP_LIBRARY_URL}?target=${+ window.name || "_blank"+ }&referrer=${referrer}&useHash=true&token=${id}&theme=${theme}&version=${+ VERSIONS.excalidrawLibrary+ }`}+ target="_excalidraw_libraries"+ >+ {t("labels.libraries")}+ </a>+ );+};++export default LibraryMenuBrowseButton;diff --git a/src/components/LibraryMenuHeaderContent.tsx b/src/components/LibraryMenuHeaderContent.tsxindex c29040ba4c..5fb578ebd0 100644--- a/src/components/LibraryMenuHeaderContent.tsx+++ b/src/components/LibraryMenuHeaderContent.tsx@@ -3,9 +3,14 @@ import { saveLibraryAsJSON } from "../data/json";import Library, { libraryItemsAtom } from "../data/library";import { t } from "../i18n";import { AppState, LibraryItem, LibraryItems } from "../types";-import { exportToFileIcon, load, publishIcon, trash } from "./icons";+import {+ DotsIcon,+ ExportIcon,+ LoadIcon,+ publishIcon,+ TrashIcon,+} from "./icons";import { ToolButton } from "./ToolButton";-import { Tooltip } from "./Tooltip";import { fileOpen } from "../data/filesystem";import { muteFSAbortError } from "../utils";import { useAtom } from "jotai";@@ -13,6 +18,9 @@ import { jotaiScope } from "../jotai";import ConfirmDialog from "./ConfirmDialog";import PublishLibrary from "./PublishLibrary";import { Dialog } from "./Dialog";+import { useOutsideClickHook } from "../hooks/useOutsideClick";+import MenuItem from "./MenuItem";+import { isDropdownOpenAtom } from "./App";const getSelectedItems = (libraryItems: LibraryItems,@@ -165,93 +173,84 @@ export const LibraryMenuHeader: React.FC<{});};+ const [isDropdownOpen, setIsDropdownOpen] = useAtom(isDropdownOpenAtom);+ const dropdownRef = useOutsideClickHook(() => setIsDropdownOpen(false));+return (- <div className="library-actions">- {showRemoveLibAlert && renderRemoveLibAlert()}- {showPublishLibraryDialog && (- <PublishLibrary- onClose={() => setShowPublishLibraryDialog(false)}- libraryItems={getSelectedItems(- libraryItemsData.libraryItems,- selectedItems,- )}- appState={appState}- onSuccess={(data) =>- onPublishLibSuccess(data, libraryItemsData.libraryItems)- }- onError={(error) => window.alert(error)}- updateItemsInStorage={() =>- library.setLibrary(libraryItemsData.libraryItems)- }- onRemove={(id: string) =>- onSelectItems(selectedItems.filter((_id) => _id !== id))- }- />- )}- {publishLibSuccess && renderPublishSuccess()}- {!itemsSelected && (- <ToolButton- key="import"- type="button"- title={t("buttons.load")}- aria-label={t("buttons.load")}- icon={load}- onClick={onLibraryImport}- className="library-actions--load"- />- )}- {!!items.length && (- <>- <ToolButton- key="export"- type="button"- title={t("buttons.export")}- aria-label={t("buttons.export")}- icon={exportToFileIcon}- onClick={onLibraryExport}- className="library-actions--export"- >- {selectedItems.length > 0 && (- <span className="library-actions-counter">- {selectedItems.length}- </span>- )}- </ToolButton>- <ToolButton- key="reset"- type="button"- title={resetLabel}- aria-label={resetLabel}- icon={trash}- onClick={() => setShowRemoveLibAlert(true)}- className="library-actions--remove"- >- {selectedItems.length > 0 && (- <span className="library-actions-counter">- {selectedItems.length}- </span>- )}- </ToolButton>- </>+ <div style={{ position: "relative" }}>+ <button+ type="button"+ className="Sidebar__dropdown-btn"+ data-prevent-outside-click+ onClick={() => setIsDropdownOpen(!isDropdownOpen)}+ >+ {DotsIcon}+ </button>++ {selectedItems.length > 0 && (+ <div className="library-actions-counter">{selectedItems.length}</div>)}- {itemsSelected && (- <Tooltip label={t("hints.publishLibrary")}>- <ToolButton- type="button"- aria-label={t("buttons.publishLibrary")}- label={t("buttons.publishLibrary")}- icon={publishIcon}- className="library-actions--publish"- onClick={() => setShowPublishLibraryDialog(true)}- >- <label>{t("buttons.publishLibrary")}</label>- {selectedItems.length > 0 && (- <span className="library-actions-counter">- {selectedItems.length}- </span>- )}- </ToolButton>- </Tooltip>++ {isDropdownOpen && (+ <div+ className="Sidebar__dropdown-content menu-container"+ ref={dropdownRef}+ >+ {!itemsSelected && (+ <MenuItem+ label={t("buttons.load")}+ icon={LoadIcon}+ dataTestId="lib-dropdown--load"+ onClick={onLibraryImport}+ />+ )}+ {showRemoveLibAlert && renderRemoveLibAlert()}+ {showPublishLibraryDialog && (+ <PublishLibrary+ onClose={() => setShowPublishLibraryDialog(false)}+ libraryItems={getSelectedItems(+ libraryItemsData.libraryItems,+ selectedItems,+ )}+ appState={appState}+ onSuccess={(data) =>+ onPublishLibSuccess(data, libraryItemsData.libraryItems)+ }+ onError={(error) => window.alert(error)}+ updateItemsInStorage={() =>+ library.setLibrary(libraryItemsData.libraryItems)+ }+ onRemove={(id: string) =>+ onSelectItems(selectedItems.filter((_id) => _id !== id))+ }+ />+ )}+ {publishLibSuccess && renderPublishSuccess()}+ {!!items.length && (+ <>+ <MenuItem+ label={t("buttons.export")}+ icon={ExportIcon}+ onClick={onLibraryExport}+ dataTestId="lib-dropdown--export"+ />+ <MenuItem+ label={resetLabel}+ icon={TrashIcon}+ onClick={() => setShowRemoveLibAlert(true)}+ dataTestId="lib-dropdown--remove"+ />+ </>+ )}+ {itemsSelected && (+ <MenuItem+ label={t("buttons.publishLibrary")}+ icon={publishIcon}+ dataTestId="lib-dropdown--publish"+ onClick={() => setShowPublishLibraryDialog(true)}+ />+ )}+ </div>)}</div>);diff --git a/src/components/LibraryMenuItems.scss b/src/components/LibraryMenuItems.scssindex ea3460ac95..1e81fdfd17 100644--- a/src/components/LibraryMenuItems.scss+++ b/src/components/LibraryMenuItems.scss@@ -1,18 +1,70 @@@import "open-color/open-color";.excalidraw {+ --container-padding-y: 1.5rem;+ --container-padding-x: 0.75rem;++ .library-menu-items__no-items {+ text-align: center;+ color: var(--color-gray-70);+ line-height: 1.5;+ font-size: 0.875rem;+ width: 100%;++ &__label {+ color: var(--color-primary);+ font-weight: bold;+ font-size: 1.125rem;+ margin-bottom: 0.75rem;+ }+ }++ &.theme--dark {+ .library-menu-items__no-items {+ color: var(--color-gray-40);+ }+ }+.library-menu-items-container {display: flex;+ flex-grow: 1;+ flex-shrink: 1;+ flex-basis: 0;+ overflow-y: auto;flex-direction: column;height: 100%;+ justify-content: center;+ margin: 0;+ border-bottom: 1px solid var(--sidebar-border-color);++ position: relative;++ &__row {+ display: grid;+ grid-template-columns: repeat(4, 1fr);+ gap: 1rem;+ }&__items {+ row-gap: 0.5rem;+ padding: var(--container-padding-y) var(--container-padding-x);flex: 1;overflow-y: auto;overflow-x: hidden;margin-bottom: 1rem;}+ &__header {+ color: var(--color-primary);+ font-size: 1.125rem;+ font-weight: bold;+ margin-bottom: 0.75rem;++ &--excal {+ margin-top: 2.5rem;+ }+ }+.separator {width: 100%;display: flex;diff --git a/src/components/LibraryMenuItems.tsx b/src/components/LibraryMenuItems.tsxindex 3c3c11e630..f6189fcb77 100644--- a/src/components/LibraryMenuItems.tsx+++ b/src/components/LibraryMenuItems.tsx@@ -2,7 +2,7 @@ import React, { useState } from "react";import { serializeLibraryAsJSON } from "../data/json";import { ExcalidrawElement, NonDeleted } from "../element/types";import { t } from "../i18n";-import { LibraryItem, LibraryItems } from "../types";+import { AppState, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";import { arrayToMap, chunk } from "../utils";import { LibraryUnit } from "./LibraryUnit";import Stack from "./Stack";@@ -10,6 +10,8 @@ import Stack from "./Stack";import "./LibraryMenuItems.scss";import { MIME_TYPES } from "../constants";import Spinner from "./Spinner";+import LibraryMenuBrowseButton from "./LibraryMenuBrowseButton";+import clsx from "clsx";const CELLS_PER_ROW = 4;@@ -21,6 +23,9 @@ const LibraryMenuItems = ({pendingElements,selectedItems,onSelectItems,+ theme,+ id,+ libraryReturnUrl,}: {isLoading: boolean;libraryItems: LibraryItems;@@ -29,6 +34,9 @@ const LibraryMenuItems = ({onAddToLibrary: (elements: LibraryItem["elements"]) => void;selectedItems: LibraryItem["id"][];onSelectItems: (id: LibraryItem["id"][]) => void;+ libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];+ theme: AppState["theme"];+ id: string;}) => {const [lastSelectedItem, setLastSelectedItem] = useState<LibraryItem["id"] | null@@ -167,7 +175,11 @@ const LibraryMenuItems = ({);}return (- <Stack.Row align="center" gap={1} key={index}>+ <Stack.Row+ align="center"+ key={index}+ className="library-menu-items-container__row"+ >{rowItems}</Stack.Row>);@@ -181,19 +193,21 @@ const LibraryMenuItems = ({(item) => item.status === "published",);+ const showBtn =+ !libraryItems.length &&+ !unpublishedItems.length &&+ !publishedItems.length &&+ !pendingElements.length;+return (<divclassName="library-menu-items-container"style={- publishedItems.length || unpublishedItems.length- ? {- flex: "1 1 0",- overflowY: "auto",- }- : {- marginBottom: "2rem",- flex: 0,- }+ pendingElements.length ||+ unpublishedItems.length ||+ publishedItems.length+ ? { justifyContent: "flex-start" }+ : {}}><Stack.Col@@ -206,49 +220,37 @@ const LibraryMenuItems = ({}}><>- <div className="separator">+ <div>{(pendingElements.length > 0 ||unpublishedItems.length > 0 ||publishedItems.length > 0) && (- <div>{t("labels.personalLib")}</div>+ <div className="library-menu-items-container__header">+ {t("labels.personalLib")}+ </div>)}{isLoading && (<divstyle={{- marginLeft: "auto",- marginRight: "1rem",- display: "flex",- alignItems: "center",- fontWeight: "normal",+ position: "absolute",+ top: "var(--container-padding-y)",+ right: "var(--container-padding-x)",+ transform: "translateY(50%)",}}>- <div style={{ transform: "translateY(2px)" }}>- <Spinner />- </div>+ <Spinner /></div>)}</div>{!pendingElements.length && !unpublishedItems.length ? (- <div- style={{- height: 65,- display: "flex",- flexDirection: "column",- alignItems: "center",- justifyContent: "center",- width: "100%",- fontSize: ".9rem",- }}- >- {t("library.noItems")}+ <div className="library-menu-items__no-items"><div- style={{- margin: ".6rem 0",- fontSize: ".8em",- width: "70%",- textAlign: "center",- }}+ className={clsx({+ "library-menu-items__no-items__label": showBtn,+ })}>+ {t("library.noItems")}+ </div>+ <div className="library-menu-items__no-items__hint">{publishedItems.length > 0? t("library.hint_emptyPrivateLibrary"): t("library.hint_emptyLibrary")}@@ -269,7 +271,9 @@ const LibraryMenuItems = ({{(publishedItems.length > 0 ||pendingElements.length > 0 ||unpublishedItems.length > 0) && (- <div className="separator">{t("labels.excalidrawLib")}</div>+ <div className="library-menu-items-container__header library-menu-items-container__header--excal">+ {t("labels.excalidrawLib")}+ </div>)}{publishedItems.length > 0 ? (renderLibrarySection(publishedItems)@@ -289,6 +293,14 @@ const LibraryMenuItems = ({</div>) : null}</>++ {showBtn && (+ <LibraryMenuBrowseButton+ id={id}+ libraryReturnUrl={libraryReturnUrl}+ theme={theme}+ />+ )}</Stack.Col></div>);diff --git a/src/components/LibraryUnit.scss b/src/components/LibraryUnit.scssindex e0c00814f5..85d7505c38 100644--- a/src/components/LibraryUnit.scss+++ b/src/components/LibraryUnit.scss@@ -7,17 +7,18 @@display: flex;justify-content: center;position: relative;- width: 63px;- height: 63px; // match width+ width: 55px;+ height: 55px;+ box-sizing: border-box;+ border-radius: var(--border-radius-lg);&--hover {- box-shadow: inset 0px 0px 0px 2px $oc-blue-5;- border-color: $oc-blue-5;+ border-color: var(--color-primary);}&--selected {- box-shadow: inset 0px 0px 0px 2px $oc-blue-8;- border-color: $oc-blue-8;+ border-color: var(--color-primary);+ border-width: 1px;}}@@ -59,20 +60,34 @@.library-unit__checkbox {position: absolute;- left: 2.3rem;- bottom: 2.3rem;+ top: 0.125rem;+ right: 0.125rem;+ margin: 0;.Checkbox-box {- width: 13px;- height: 13px;- border-radius: 2px;- margin: 0.5em 0.5em 0.2em 0.2em;- background-color: $oc-blue-1;+ margin: 0;+ width: 1rem;+ height: 1rem;+ border-radius: 4px;+ background-color: var(--color-primary-light);+ border: 1px solid var(--color-primary);+ box-shadow: none !important;+ padding: 2px;}&.Checkbox:hover {.Checkbox-box {- background-color: $oc-blue-2;+ background-color: var(--color-primary-light);+ }+ }++ &.is-checked {+ .Checkbox-box {+ background-color: var(--color-primary) !important;++ svg {+ color: var(--color-primary-light);+ }}}}@@ -85,25 +100,29 @@.library-unit__adder {transform: scale(1);animation: library-unit__adder-animation 1s ease-in infinite;- }- .library-unit__adder {position: absolute;- left: 40%;- top: 40%;- width: 2rem;- height: 2rem;- margin-left: -10px;- margin-top: -10px;+ width: 1.5rem;+ height: 1.5rem;+ background-color: var(--color-primary);+ border-radius: var(--border-radius-md);++ display: flex;+ justify-content: center;+ align-items: center;+pointer-events: none;++ svg {+ color: var(--color-primary-light);+ width: 1rem;+ height: 1rem;+ }}- .library-unit:hover .library-unit__adder {- fill: $oc-blue-7;- }+.library-unit:active .library-unit__adder {animation: none;transform: scale(0.8);- fill: $oc-black;}.library-unit__active {diff --git a/src/components/LibraryUnit.tsx b/src/components/LibraryUnit.tsxindex 5d9a56aee3..aae7a8b5fd 100644--- a/src/components/LibraryUnit.tsx+++ b/src/components/LibraryUnit.tsx@@ -6,19 +6,7 @@ import { exportToSvg } from "../scene/export";import { LibraryItem } from "../types";import "./LibraryUnit.scss";import { CheckboxItem } from "./CheckboxItem";--const PLUS_ICON = (- <svg viewBox="0 0 1792 1792">- <path- d="M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z"- style={{- stroke: "#fff",- strokeWidth: 140,- }}- transform="translate(0 64)"- />- </svg>-);+import { PlusIcon } from "./icons";export const LibraryUnit = ({id,@@ -67,7 +55,7 @@ export const LibraryUnit = ({const [isHovered, setIsHovered] = useState(false);const isMobile = useDevice().isMobile;const adder = isPending && (- <div className="library-unit__adder">{PLUS_ICON}</div>+ <div className="library-unit__adder">{PlusIcon}</div>);return (diff --git a/src/components/LockButton.tsx b/src/components/LockButton.tsxindex b71c8460a3..bb5b6d9f0f 100644--- a/src/components/LockButton.tsx+++ b/src/components/LockButton.tsx@@ -1,8 +1,8 @@import "./ToolIcon.scss";-import React from "react";import clsx from "clsx";import { ToolButtonSize } from "./ToolButton";+import { LockedIcon, UnlockedIcon } from "./icons";type LockIconProps = {title?: string;@@ -16,34 +16,15 @@ type LockIconProps = {const DEFAULT_SIZE: ToolButtonSize = "medium";const ICONS = {- CHECKED: (- <svg- width="1792"- height="1792"- viewBox="0 0 1792 1792"- xmlns="http://www.w3.org/2000/svg"- >- <path d="M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z" />- </svg>- ),- UNCHECKED: (- <svg- width="1792"- height="1792"- viewBox="0 0 1792 1792"- xmlns="http://www.w3.org/2000/svg"- className="unlocked-icon rtl-mirror"- >- <path d="M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z" />- </svg>- ),+ CHECKED: LockedIcon,+ UNCHECKED: UnlockedIcon,};export const LockButton = (props: LockIconProps) => {return (<labelclassName={clsx(- "ToolIcon ToolIcon__lock ToolIcon_type_floating",+ "ToolIcon ToolIcon__lock",`ToolIcon_size_${DEFAULT_SIZE}`,{"is-mobile": props.isMobile,diff --git a/src/components/Menu.scss b/src/components/Menu.scssnew file mode 100644index 0000000000..6a22b0b8e8--- /dev/null+++ b/src/components/Menu.scss@@ -0,0 +1,85 @@+@import "../css/variables.module";++.excalidraw {+ .menu-container {+ background-color: #fff !important;+ max-height: calc(100vh - 150px);+ overflow-y: auto;+ }++ .menu-button {+ @include outlineButtonStyles;+ background-color: var(--island-bg-color);+ width: var(--lg-button-size);+ height: var(--lg-button-size);++ svg {+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);+ }+ }++ .menu-item {+ display: flex;+ background-color: transparent;+ border: 0;+ align-items: center;+ padding: 0 0.625rem;+ height: 2rem;+ column-gap: 0.625rem;+ font-size: 0.875rem;+ color: var(--color-gray-100);+ cursor: pointer;+ border-radius: var(--border-radius-md);+ width: 100%;+ box-sizing: border-box;+ font-weight: normal;+ font-family: inherit;++ @media screen and (min-width: 1921px) {+ height: 2.25rem;+ }++ &__text {+ text-overflow: ellipsis;+ overflow: hidden;+ white-space: nowrap;+ }++ &__shortcut {+ margin-inline-start: auto;+ opacity: 0.5;+ }++ &:hover {+ background-color: var(--button-hover);+ text-decoration: none;+ }++ svg {+ width: 1rem;+ height: 1rem;+ display: block;+ }++ &.active-collab {+ background-color: #ecfdf5;+ color: #064e3c;+ }+ }++ &.theme--dark {+ .menu-item {+ color: var(--color-gray-40);++ &.active-collab {+ background-color: #064e3c;+ color: #ecfdf5;+ }+ }++ .menu-container {+ background-color: var(--color-gray-90) !important;+ }+ }+}diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsxnew file mode 100644index 0000000000..8bfe3d7537--- /dev/null+++ b/src/components/MenuItem.tsx@@ -0,0 +1,37 @@+import clsx from "clsx";+import "./Menu.scss";++interface MenuProps {+ icon: JSX.Element;+ onClick: () => void;+ label: string;+ dataTestId: string;+ shortcut?: string;+ isCollaborating?: boolean;+}++const MenuItem = ({+ icon,+ onClick,+ label,+ dataTestId,+ shortcut,+ isCollaborating,+}: MenuProps) => {+ return (+ <button+ className={clsx("menu-item", { "active-collab": isCollaborating })}+ aria-label={label}+ onClick={onClick}+ data-testid={dataTestId}+ title={label}+ type="button"+ >+ <div className="menu-item__icon">{icon}</div>+ <div className="menu-item__text">{label}</div>+ {shortcut && <div className="menu-item__shortcut">{shortcut}</div>}+ </button>+ );+};++export default MenuItem;diff --git a/src/components/MenuUtils.tsx b/src/components/MenuUtils.tsxnew file mode 100644index 0000000000..90cf050375--- /dev/null+++ b/src/components/MenuUtils.tsx@@ -0,0 +1,53 @@+import { GithubIcon, DiscordIcon, PlusPromoIcon, TwitterIcon } from "./icons";++export const MenuLinks = () => (+ <>+ <a+ href="https://plus.excalidraw.com/plus?utm_source=excalidraw&utm_medium=app&utm_content=hamburger"+ target="_blank"+ rel="noreferrer"+ className="menu-item"+ style={{ color: "var(--color-promo)" }}+ >+ <div className="menu-item__icon">{PlusPromoIcon}</div>+ <div className="menu-item__text">Excalidraw+</div>+ </a>+ <a+ className="menu-item"+ href="https://github.com/excalidraw/excalidraw"+ target="_blank"+ rel="noopener noreferrer"+ >+ <div className="menu-item__icon">{GithubIcon}</div>+ <div className="menu-item__text">GitHub</div>+ </a>+ <a+ className="menu-item"+ target="_blank"+ href="https://discord.gg/UexuTaE"+ rel="noopener noreferrer"+ >+ <div className="menu-item__icon">{DiscordIcon}</div>+ <div className="menu-item__text">Discord</div>+ </a>+ <a+ className="menu-item"+ target="_blank"+ href="https://twitter.com/excalidraw"+ rel="noopener noreferrer"+ >+ <div className="menu-item__icon">{TwitterIcon}</div>+ <div className="menu-item__text">Twitter</div>+ </a>+ </>+);++export const Separator = () => (+ <div+ style={{+ height: "1px",+ backgroundColor: "var(--default-border-color)",+ margin: ".5rem 0",+ }}+ />+);diff --git a/src/components/MobileMenu.tsx b/src/components/MobileMenu.tsxindex 9abafeb937..732d8fce6c 100644--- a/src/components/MobileMenu.tsx+++ b/src/components/MobileMenu.tsx@@ -8,18 +8,21 @@ import { NonDeletedExcalidrawElement } from "../element/types";import { FixedSideContainer } from "./FixedSideContainer";import { Island } from "./Island";import { HintViewer } from "./HintViewer";-import { calculateScrollCenter, getSelectedElements } from "../scene";+import { calculateScrollCenter } from "../scene";import { SelectedShapeActions, ShapesSwitcher } from "./Actions";import { Section } from "./Section";import CollabButton from "./CollabButton";import { SCROLLBAR_WIDTH, SCROLLBAR_MARGIN } from "../scene/scrollbars";import { LockButton } from "./LockButton";import { UserList } from "./UserList";-import { BackgroundPickerAndDarkModeToggle } from "./BackgroundPickerAndDarkModeToggle";import { LibraryButton } from "./LibraryButton";import { PenModeButton } from "./PenModeButton";import { Stats } from "./Stats";import { actionToggleStats } from "../actions";+import { MenuLinks, Separator } from "./MenuUtils";+import WelcomeScreen from "./WelcomeScreen";+import MenuItem from "./MenuItem";+import { ExportImageIcon } from "./icons";type MobileMenuProps = {appState: AppState;@@ -45,6 +48,7 @@ type MobileMenuProps = {renderCustomStats?: ExcalidrawProps["renderCustomStats"];renderSidebars: () => JSX.Element | null;device: Device;+ renderWelcomeScreen?: boolean;};export const MobileMenu = ({@@ -65,17 +69,35 @@ export const MobileMenu = ({renderCustomStats,renderSidebars,device,+ renderWelcomeScreen,}: MobileMenuProps) => {const renderToolbar = () => {return (<FixedSideContainer side="top" className="App-top-bar">+ {renderWelcomeScreen && !appState.isLoading && (+ <WelcomeScreen actionManager={actionManager} />+ )}<Section heading="shapes">{(heading: React.ReactNode) => (<Stack.Col gap={4} align="center"><Stack.Row gap={1} className="App-toolbar-container">- <Island padding={1} className="App-toolbar">+ <Island padding={1} className="App-toolbar App-toolbar--mobile">{heading}<Stack.Row gap={1}>+ {/* <PenModeButton+ checked={appState.penMode}+ onChange={onPenModeToggle}+ title={t("toolBar.penMode")}+ isMobile+ penDetected={appState.penDetected}+ />+ <LockButton+ checked={appState.activeTool.locked}+ onChange={onLockToggle}+ title={t("toolBar.lock")}+ isMobile+ />+ <div className="App-toolbar__divider"></div> */}<ShapesSwitcherappState={appState}canvas={canvas}@@ -90,24 +112,27 @@ export const MobileMenu = ({</Stack.Row></Island>{renderTopRightUI && renderTopRightUI(true, appState)}- <LockButton- checked={appState.activeTool.locked}- onChange={onLockToggle}- title={t("toolBar.lock")}- isMobile- />- <LibraryButton- appState={appState}- setAppState={setAppState}- isMobile- />- <PenModeButton- checked={appState.penMode}- onChange={onPenModeToggle}- title={t("toolBar.penMode")}- isMobile- penDetected={appState.penDetected}- />+ <div className="mobile-misc-tools-container">+ <PenModeButton+ checked={appState.penMode}+ onChange={onPenModeToggle}+ title={t("toolBar.penMode")}+ isMobile+ penDetected={appState.penDetected}+ // penDetected={true}+ />+ <LockButton+ checked={appState.activeTool.locked}+ onChange={onLockToggle}+ title={t("toolBar.lock")}+ isMobile+ />+ <LibraryButton+ appState={appState}+ setAppState={setAppState}+ isMobile+ />+ </div></Stack.Row></Stack.Col>)}@@ -123,11 +148,6 @@ export const MobileMenu = ({};const renderAppToolbar = () => {- // Render eraser conditionally in mobile- const showEraser =- !appState.editingElement &&- getSelectedElements(elements, appState).length === 0;-if (appState.viewModeEnabled) {return (<div className="App-toolbar-content">@@ -140,14 +160,11 @@ export const MobileMenu = ({<div className="App-toolbar-content">{actionManager.renderAction("toggleCanvasMenu")}{actionManager.renderAction("toggleEditMenu")}-{actionManager.renderAction("undo")}{actionManager.renderAction("redo")}- {showEraser- ? actionManager.renderAction("eraser")- : actionManager.renderAction(- appState.multiElement ? "finalize" : "duplicateSelection",- )}+ {actionManager.renderAction(+ appState.multiElement ? "finalize" : "duplicateSelection",+ )}{actionManager.renderAction("deleteSelectedElements")}</div>);@@ -158,16 +175,27 @@ export const MobileMenu = ({return (<>{renderJSONExportDialog()}+ <MenuItem+ label={t("buttons.exportImage")}+ icon={ExportImageIcon}+ dataTestId="image-export-button"+ onClick={() => setAppState({ openDialog: "imageExport" })}+ />{renderImageExportDialog()}</>);}return (<>- {actionManager.renderAction("clearCanvas")}{actionManager.renderAction("loadScene")}{renderJSONExportDialog()}{renderImageExportDialog()}+ <MenuItem+ label={t("buttons.exportImage")}+ icon={ExportImageIcon}+ dataTestId="image-export-button"+ onClick={() => setAppState({ openDialog: "imageExport" })}+ />{onCollabButtonClick && (<CollabButtonisCollaborating={isCollaborating}@@ -175,7 +203,20 @@ export const MobileMenu = ({onClick={onCollabButtonClick}/>)}- {<BackgroundPickerAndDarkModeToggle actionManager={actionManager} />}+ {actionManager.renderAction("toggleShortcuts", undefined, true)}+ {actionManager.renderAction("clearCanvas")}+ <Separator />+ <MenuLinks />+ <Separator />+ <div style={{ marginBottom: ".5rem" }}>+ <div style={{ fontSize: ".75rem", marginBottom: ".5rem" }}>+ {t("labels.canvasBackground")}+ </div>+ <div style={{ padding: "0 0.625rem" }}>+ {actionManager.renderAction("changeViewBackgroundColor")}+ </div>+ </div>+ {actionManager.renderAction("toggleTheme")}</>);};@@ -206,7 +247,7 @@ export const MobileMenu = ({{appState.openMenu === "canvas" ? (<Section className="App-mobile-menu" heading="canvasActions"><div className="panelColumn">- <Stack.Col gap={4}>+ <Stack.Col gap={2}>{renderCanvasActions()}{renderCustomFooter?.(true, appState)}{appState.collaborators.size > 0 && (diff --git a/src/components/Modal.scss b/src/components/Modal.scssindex 0dac73b266..71a1a4c0f9 100644--- a/src/components/Modal.scss+++ b/src/components/Modal.scss@@ -17,6 +17,10 @@justify-content: center;overflow: auto;padding: calc(var(--space-factor) * 10);++ .Island {+ padding: 2.5rem !important;+ }}.Modal__background {@@ -26,7 +30,7 @@right: 0;bottom: 0;z-index: 1;- background-color: transparentize($oc-black, 0.3);+ background-color: rgba(#121212, 0.2);}.Modal__content {@@ -46,7 +50,7 @@background: var(--island-bg-color);border: 1px solid var(--dialog-border-color);- box-shadow: 0 2px 10px transparentize($oc-black, 0.75);+ box-shadow: var(--modal-shadow);border-radius: 6px;box-sizing: border-box;@@ -73,14 +77,20 @@}.Modal__close {- width: calc(var(--space-factor) * 7);- height: calc(var(--space-factor) * 7);- display: flex;- align-items: center;- justify-content: center;+ color: var(--icon-fill-color);+ margin: 0;+ padding: 0.375rem;+ position: absolute;+ top: 1rem;+ right: 1rem;+ border: 0;+ background-color: transparent;+ line-height: 0;+ cursor: pointer;svg {- height: calc(var(--space-factor) * 5);+ width: 1.5rem;+ height: 1.5rem;}}diff --git a/src/components/Modal.tsx b/src/components/Modal.tsxindex 325fe28014..3d774b3df0 100644--- a/src/components/Modal.tsx+++ b/src/components/Modal.tsx@@ -39,6 +39,7 @@ export const Modal: React.FC<{aria-modal="true"onKeyDown={handleKeydown}aria-labelledby={props.labelledBy}+ data-prevent-outside-click><divclassName="Modal__background"diff --git a/src/components/PenModeButton.tsx b/src/components/PenModeButton.tsxindex 807c36c419..7c61d18a2b 100644--- a/src/components/PenModeButton.tsx+++ b/src/components/PenModeButton.tsx@@ -2,6 +2,7 @@ import "./ToolIcon.scss";import clsx from "clsx";import { ToolButtonSize } from "./ToolButton";+import { PenModeIcon } from "./icons";type PenModeIconProps = {title?: string;@@ -15,59 +16,15 @@ type PenModeIconProps = {const DEFAULT_SIZE: ToolButtonSize = "medium";-const ICONS = {- CHECKED: (- <svg- width="205"- height="205"- viewBox="0 0 205 205"- xmlns="http://www.w3.org/2000/svg"- >- <path d="m35 195-25-29.17V50h50v115l-25 30" />- <path d="M10 40V10h50v30H10" />- <path d="M125 145h70v50h-70" />- <path d="M190 145v-30l-10-20h-40l-10 20v30h15v-30l5-5h20l5 5v30h15" />- </svg>- ),- UNCHECKED: (- <svg- width="205"- height="205"- viewBox="0 0 205 205"- xmlns="http://www.w3.org/2000/svg"- className="unlocked-icon rtl-mirror"- >- <path d="m35 195-25-29.17V50h50v115l-25 30" />- <path d="M10 40V10h50v30H10" />- <path d="M125 145h70v50h-70" />- <path d="M145 145v-30l-10-20H95l-10 20v30h15v-30l5-5h20l5 5v30h15" />- </svg>- ),-};-export const PenModeButton = (props: PenModeIconProps) => {if (!props.penDetected) {- if (props.isMobile) {- return null;- }- return (- <label- className={clsx(- "ToolIcon ToolIcon__penMode ToolIcon_type_floating",- `ToolIcon_size_${DEFAULT_SIZE}`,- {- "is-mobile": props.isMobile,- },- )}- >- <div className="ToolIcon__icon ToolIcon__hidden" />- </label>- );+ return null;}+return (<labelclassName={clsx(- "ToolIcon ToolIcon__penMode ToolIcon_type_floating",+ "ToolIcon ToolIcon__penMode",`ToolIcon_size_${DEFAULT_SIZE}`,{"is-mobile": props.isMobile,@@ -83,9 +40,7 @@ export const PenModeButton = (props: PenModeIconProps) => {checked={props.checked}aria-label={props.title}/>- <div className="ToolIcon__icon">- {props.checked ? ICONS.CHECKED : ICONS.UNCHECKED}- </div>+ <div className="ToolIcon__icon">{PenModeIcon}</div></label>);};diff --git a/src/components/PublishLibrary.scss b/src/components/PublishLibrary.scssindex 7063b7881d..6040ff2f48 100644--- a/src/components/PublishLibrary.scss+++ b/src/components/PublishLibrary.scss@@ -7,7 +7,7 @@flex-direction: column;label {- padding: 1em;+ padding: 1em 0;display: flex;justify-content: space-between;align-items: center;@@ -34,6 +34,7 @@display: flex;padding: 0.2rem 0;justify-content: flex-end;+ gap: 0.5rem;.ToolIcon__icon {min-width: 2.5rem;@@ -74,7 +75,6 @@.selected-library-items {display: flex;- padding: 0 0.8rem;flex-wrap: wrap;.single-library-item-wrapper {@@ -87,7 +87,7 @@}&-note {- padding: 1em;+ padding: 1em 0;font-style: italic;font-size: 14px;display: block;diff --git a/src/components/PublishLibrary.tsx b/src/components/PublishLibrary.tsxindex 37543b6b06..0d060dfaa8 100644--- a/src/components/PublishLibrary.tsx+++ b/src/components/PublishLibrary.tsx@@ -4,8 +4,6 @@ import OpenColor from "open-color";import { Dialog } from "./Dialog";import { t } from "../i18n";-import { ToolButton } from "./ToolButton";-import { AppState, LibraryItems, LibraryItem } from "../types";import { exportToCanvas } from "../packages/utils";import {@@ -20,6 +18,7 @@ import "./PublishLibrary.scss";import SingleLibraryItem from "./SingleLibraryItem";import { canvasToBlob, resizeImageFile } from "../data/blob";import { chunk } from "../utils";+import DialogActionButton from "./DialogActionButton";interface PublishLibraryDataParams {authorName: string;@@ -434,21 +433,15 @@ const PublishLibrary = ({</span></div><div className="publish-library__buttons">- <ToolButton- type="button"- title={t("buttons.cancel")}- aria-label={t("buttons.cancel")}+ <DialogActionButtonlabel={t("buttons.cancel")}onClick={onDialogClose}data-testid="cancel-clear-canvas-button"- className="publish-library__buttons--cancel"/>- <ToolButton+ <DialogActionButtontype="submit"- title={t("buttons.submit")}- aria-label={t("buttons.submit")}label={t("buttons.submit")}- className="publish-library__buttons--confirm"+ actionType="primary"isLoading={isSubmitting}/></div>diff --git a/src/components/Sidebar/Sidebar.scss b/src/components/Sidebar/Sidebar.scssindex b3a19ffc14..b71f06cd3f 100644--- a/src/components/Sidebar/Sidebar.scss+++ b/src/components/Sidebar/Sidebar.scss@@ -2,20 +2,101 @@@import "../../css/variables.module";.excalidraw {+ .Sidebar {+ &__dropdown-content {+ z-index: 1;+ position: absolute;+ top: 100%;+ left: 0;++ :root[dir="rtl"] & {+ right: 0;+ left: auto;+ }++ margin-top: 0.25rem;+ width: 180px;+ box-shadow: var(--library-dropdown-shadow);+ border-radius: var(--border-radius-lg);+ padding: 0.25rem 0.5rem;+ }++ &__close-btn,+ &__pin-btn,+ &__dropdown-btn {+ @include outlineButtonStyles;+ width: var(--lg-button-size);+ height: var(--lg-button-size);+ padding: 0;++ svg {+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);+ }+ }++ &__pin-btn {+ &--pinned {+ background-color: var(--color-primary);+ border-color: var(--color-primary);++ svg {+ color: #fff;+ }++ &:hover,+ &:active {+ background-color: var(--color-primary-darker);+ }+ }+ }+ }++ &.theme--dark {+ .Sidebar {+ &__pin-btn {+ &--pinned {+ svg {+ color: var(--color-gray-90);+ }+ }+ }+ }+ }+.layer-ui__sidebar {position: absolute;- top: var(--sat);- bottom: var(--sab);- right: var(--sar);+ top: 0;+ bottom: 0;+ right: 0;z-index: 5;+ margin: 0;++ :root[dir="rtl"] & {+ left: 0;+ right: auto;+ }++ background-color: var(--sidebar-bg-color);++ box-shadow: var(--sidebar-shadow);++ &--docked {+ box-shadow: none;+ }- box-shadow: var(--shadow-island);overflow: hidden;- border-radius: var(--border-radius-lg);- margin: var(--space-factor);+ border-radius: 0;width: calc(#{$right-sidebar-width} - var(--space-factor) * 2);- padding: 0.5rem;+ border-left: 1px solid var(--sidebar-border-color);++ :root[dir="rtl"] & {+ border-right: 1px solid var(--sidebar-border-color);+ border-left: 0;+ }++ padding: 0;box-sizing: border-box;.Island {@@ -48,42 +129,18 @@}.layer-ui__sidebar__header {+ box-sizing: border-box;display: flex;+ justify-content: space-between;align-items: center;width: 100%;- margin: 2px 0 15px 0;- &:empty {- margin: 0;- }- button {- // 2px from the left to account for focus border of left-most button- margin: 0 2px;- }+ padding: 1rem;+ border-bottom: 1px solid var(--sidebar-border-color);}.layer-ui__sidebar__header__buttons {display: flex;align-items: center;- margin-left: auto;- }-- .layer-ui__sidebar-dock-button {- @include toolbarButtonColorStates;- margin-right: 0.2rem;-- .ToolIcon_type_floating .ToolIcon__icon {- width: calc(var(--space-factor) * 7);- height: calc(var(--space-factor) * 7);- svg {- // mirror- transform: scale(-1, 1);- }- }-- .ToolIcon_type_checkbox {- &:not(.ToolIcon_toggle_opaque):checked + .ToolIcon__icon {- background-color: var(--color-primary);- }- }+ gap: 0.625rem;}}diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsxindex cf55240af2..225b2e2fb2 100644--- a/src/components/Sidebar/Sidebar.tsx+++ b/src/components/Sidebar/Sidebar.tsx@@ -33,6 +33,13 @@ export const Sidebar = Object.assign(onClose,onDock,docked,+ /** Undocumented, may be removed later. Generally should either be+ * `props.docked` or `appState.isSidebarDocked`. Currently serves to+ * prevent unwanted animation of the shadow if initially docked. */+ //+ // NOTE we'll want to remove this after we sort out how to subscribe to+ // individual appState properties+ initialDockedState = docked,dockable = true,className,__isInternal,@@ -52,7 +59,9 @@ export const Sidebar = Object.assign(const setAppState = useExcalidrawSetAppState();- const [isDockedFallback, setIsDockedFallback] = useState(docked ?? false);+ const [isDockedFallback, setIsDockedFallback] = useState(+ docked ?? initialDockedState ?? false,+ );useLayoutEffect(() => {if (docked === undefined) {@@ -119,8 +128,11 @@ export const Sidebar = Object.assign(return (<Island- padding={2}- className={clsx("layer-ui__sidebar", className)}+ className={clsx(+ "layer-ui__sidebar",+ { "layer-ui__sidebar--docked": isDockedFallback },+ className,+ )}ref={ref}><SidebarPropsContext.Provider value={headerPropsRef.current}>diff --git a/src/components/Sidebar/SidebarHeader.tsx b/src/components/Sidebar/SidebarHeader.tsxindex 3c8ccc1264..bb107216c7 100644--- a/src/components/Sidebar/SidebarHeader.tsx+++ b/src/components/Sidebar/SidebarHeader.tsx@@ -3,16 +3,10 @@ import { useContext } from "react";import { t } from "../../i18n";import { useDevice } from "../App";import { SidebarPropsContext } from "./common";-import { close } from "../icons";+import { CloseIcon, PinIcon } from "../icons";import { withUpstreamOverride } from "../hoc/withUpstreamOverride";import { Tooltip } from "../Tooltip";-const SIDE_LIBRARY_TOGGLE_ICON = (- <svg viewBox="0 0 24 24" fill="#ffffff">- <path d="M19 22H5a3 3 0 01-3-3V5a3 3 0 013-3h14a3 3 0 013 3v14a3 3 0 01-3 3zm0-18h-9v16h9a1.01 1.01 0 001-1V5a1.01 1.01 0 00-1-1z"></path>- </svg>-);-export const SidebarDockButton = (props: {checked: boolean;onChange?(): void;@@ -33,8 +27,13 @@ export const SidebarDockButton = (props: {checked={props.checked}aria-label={t("labels.sidebarLock")}/>{" "}- <div className="ToolIcon__icon" tabIndex={0}>- {SIDE_LIBRARY_TOGGLE_ICON}+ <div+ className={clsx("Sidebar__pin-btn", {+ "Sidebar__pin-btn--pinned": props.checked,+ })}+ tabIndex={0}+ >+ {PinIcon}</div>{" "}</label>{" "}</Tooltip>@@ -64,24 +63,19 @@ const _SidebarHeader: React.FC<{<SidebarDockButtonchecked={!!props.docked}onChange={() => {- document- .querySelector(".layer-ui__wrapper")- ?.classList.add("animate");-props.onDock?.(!props.docked);}}/>)}{renderCloseButton && (- <div className="ToolIcon__icon__close" data-testid="sidebar-close">- <button- className="Modal__close"- onClick={props.onClose}- aria-label={t("buttons.close")}- >- {close}- </button>- </div>+ <button+ data-testid="sidebar-close"+ className="Sidebar__close-btn"+ onClick={props.onClose}+ aria-label={t("buttons.close")}+ >+ {CloseIcon}+ </button>)}</div>)}diff --git a/src/components/Sidebar/common.ts b/src/components/Sidebar/common.tsindex e2b310b78f..97c72b5d3b 100644--- a/src/components/Sidebar/common.ts+++ b/src/components/Sidebar/common.ts@@ -9,6 +9,7 @@ export type SidebarProps<P = {}> = {/** if not supplied, sidebar won't be dockable */onDock?: (docked: boolean) => void;docked?: boolean;+ initialDockedState?: boolean;dockable?: boolean;className?: string;} & P;diff --git a/src/components/SingleLibraryItem.tsx b/src/components/SingleLibraryItem.tsxindex 2dc81295ec..45959199ca 100644--- a/src/components/SingleLibraryItem.tsx+++ b/src/components/SingleLibraryItem.tsx@@ -3,7 +3,7 @@ import { useEffect, useRef } from "react";import { t } from "../i18n";import { exportToSvg } from "../packages/utils";import { AppState, LibraryItem } from "../types";-import { close } from "./icons";+import { CloseIcon } from "./icons";import "./SingleLibraryItem.scss";import { ToolButton } from "./ToolButton";@@ -54,7 +54,7 @@ const SingleLibraryItem = ({<ToolButtonaria-label={t("buttons.remove")}type="button"- icon={close}+ icon={CloseIcon}className="single-library-item--remove"onClick={onRemove.bind(null, libItem.id)}title={t("buttons.remove")}@@ -62,7 +62,7 @@ const SingleLibraryItem = ({<divstyle={{display: "flex",- margin: "0.8rem 0.3rem",+ margin: "0.8rem 0",width: "100%",fontSize: "14px",fontWeight: 500,diff --git a/src/components/Stats.tsx b/src/components/Stats.tsxindex dc7c7965ae..8aad760264 100644--- a/src/components/Stats.tsx+++ b/src/components/Stats.tsx@@ -4,7 +4,7 @@ import { NonDeletedExcalidrawElement } from "../element/types";import { t } from "../i18n";import { getTargetElements } from "../scene";import { AppState, ExcalidrawProps } from "../types";-import { close } from "./icons";+import { CloseIcon } from "./icons";import { Island } from "./Island";import "./Stats.scss";@@ -23,7 +23,7 @@ export const Stats = (props: {<div className="Stats"><Island padding={2}><div className="close" onClick={props.onClose}>- {close}+ {CloseIcon}</div><h3>{t("stats.title")}</h3><table>diff --git a/src/components/Toast.tsx b/src/components/Toast.tsxindex 56eb94dbf4..be0c466630 100644--- a/src/components/Toast.tsx+++ b/src/components/Toast.tsx@@ -1,5 +1,5 @@import { useCallback, useEffect, useRef } from "react";-import { close } from "./icons";+import { CloseIcon } from "./icons";import "./Toast.scss";import { ToolButton } from "./ToolButton";@@ -47,7 +47,7 @@ export const Toast = ({<p className="Toast__message">{message}</p>{closable && (<ToolButton- icon={close}+ icon={CloseIcon}aria-label="close"type="icon"onClick={onClose}diff --git a/src/components/ToolIcon.scss b/src/components/ToolIcon.scssindex b8031a438f..994ee6ba5f 100644--- a/src/components/ToolIcon.scss+++ b/src/components/ToolIcon.scss@@ -3,12 +3,19 @@.excalidraw {.ToolIcon {+ border-radius: var(--border-radius-lg);display: inline-flex;align-items: center;position: relative;cursor: pointer;-webkit-tap-highlight-color: transparent;user-select: none;++ &__hidden {+ display: none !important;+ }++ @include toolbarButtonColorStates;}.ToolIcon--plain {@@ -21,21 +28,15 @@.ToolIcon_type_radio,.ToolIcon_type_checkbox {- & + .ToolIcon__icon {- background-color: var(--button-gray-1);-- &:hover {- background-color: var(--button-gray-2);- }- &:active {- background-color: var(--button-gray-3);- }- }+ position: absolute;+ opacity: 0;+ pointer-events: none;}.ToolIcon__icon {- width: 2.5rem;- height: 2.5rem;+ box-sizing: border-box;+ width: var(--default-button-size);+ height: var(--default-button-size);color: var(--icon-fill-color);display: flex;@@ -50,8 +51,8 @@svg {position: relative;- height: 1em;- fill: var(--icon-fill-color);+ width: var(--default-icon-size);+ height: var(--default-icon-size);color: var(--icon-fill-color);}}@@ -75,13 +76,14 @@font-size: 0.8em;}- .excalidraw .ToolIcon_type_button,+ .ToolIcon_type_button,.Modal .ToolIcon_type_button,.ToolIcon_type_button {padding: 0;border: none;margin: 0;font-size: inherit;+ background-color: initial;&:focus-visible {box-shadow: 0 0 0 2px var(--focus-highlight-color);@@ -95,9 +97,9 @@}}- &:hover {- background-color: var(--button-gray-2);- }+ // &:hover {+ // background-color: var(--button-gray-2);+ // }&:active {background-color: var(--button-gray-3);@@ -108,29 +110,8 @@}&--hide {- visibility: hidden;- }- }-- .ToolIcon_type_radio,- .ToolIcon_type_checkbox {- position: absolute;- opacity: 0;- pointer-events: none;-- &:not(.ToolIcon_toggle_opaque):checked + .ToolIcon__icon {- background-color: var(--button-gray-2);- &:active {- background-color: var(--button-gray-3);- }- }-- &:focus-visible + .ToolIcon__icon {- box-shadow: 0 0 0 2px var(--focus-highlight-color);- }-- &:active + .ToolIcon__icon {- background-color: var(--button-gray-3);+ // visibility: hidden;+ display: none !important;}}@@ -163,66 +144,12 @@position: absolute;bottom: 2px;right: 3px;- font-size: 0.5em;+ font-size: 0.625rem;color: var(--keybinding-color);font-family: var(--ui-font);user-select: none;}- // shrink shape icons on small viewports to make them fit- @media (max-width: 425px) {- .Shape .ToolIcon__icon {- width: 2rem;- height: 2rem;-- svg {- height: 0.8em;- }- }- }-- // move the lock button out of the way on small viewports- // it begins to collide with the GitHub icon before we switch to mobile mode- @media (max-width: 760px) {- .ToolIcon.ToolIcon_type_floating {- display: inline-block;- position: absolute;- right: -8px;-- margin-left: 0;- border-radius: 20px 0 0 20px;- z-index: 1;-- background-color: var(--button-gray-1);-- &:hover {- background-color: var(--button-gray-1);- }-- &:active {- background-color: var(--button-gray-2);- }-- .ToolIcon__icon {- border-radius: inherit;- }-- svg {- position: static;- }- }- .ToolIcon.ToolIcon__library {- top: calc(var(--sat) + 100px);- }-- .ToolIcon.ToolIcon__lock {- top: calc(var(--sat) + 60px);- }- .ToolIcon.ToolIcon__penMode {- top: calc(var(--sat) + 140px);- }- }-.unlocked-icon {:root[dir="ltr"] & {left: 2px;@@ -232,4 +159,16 @@right: 2px;}}++ .App-toolbar-container {+ .ToolIcon__icon {+ width: var(--lg-button-size);+ height: var(--lg-button-size);++ svg {+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);+ }+ }+ }}diff --git a/src/components/Toolbar.scss b/src/components/Toolbar.scssindex a70745d426..da305b8bab 100644--- a/src/components/Toolbar.scss+++ b/src/components/Toolbar.scss@@ -2,101 +2,20 @@@import "../css/variables.module";.excalidraw {- .App-toolbar-container {- .ToolIcon_type_floating {- @include toolbarButtonColorStates;-- &:not(.is-mobile) {- .ToolIcon__icon {- padding: 1px;- background-color: var(--island-bg-color);- box-shadow: 1px 3px 4px 0px rgb(0 0 0 / 15%);- border-radius: 50%;- transition: box-shadow 0.5s ease, transform 0.5s ease;- }- }-- .ToolIcon_type_radio,- .ToolIcon_type_checkbox {- &:focus-within + .ToolIcon__icon {- // override for custom floating button shadow- box-shadow: 0 0 0 2px var(--focus-highlight-color);- }- }- }-- .ToolIcon__hidden {- box-shadow: none !important;- background-color: transparent !important;- pointer-events: none !important;- }-- .ToolIcon.ToolIcon__lock {- &.ToolIcon_type_floating {- margin-left: 0.1rem;- }- }-- .ToolIcon__library {- margin-inline-start: var(--space-factor);- }-- &.zen-mode {- .ToolIcon_type_floating {- .ToolIcon__icon {- box-shadow: none;- transform: scale(0.9);- }- .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active) {- & + .ToolIcon__icon {- svg {- fill: $oc-gray-5;- color: $oc-gray-5;- }- }- }- }- }- }-.App-toolbar {- border-radius: var(--border-radius-lg);- box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 15%);-- .ToolIcon {- &:hover {- --icon-fill-color: var(- --color-primary-contrast-offset,- var(--color-primary)- );- --keybinding-color: var(- --color-primary-contrast-offset,- var(--color-primary)- );- }- &:active {- --icon-fill-color: #{$oc-gray-9};- --keybinding-color: #{$oc-gray-9};- }-- .ToolIcon__icon {- background: transparent;- border-radius: var(--border-radius-lg);- }-- @include toolbarButtonColorStates;- }-&.zen-mode {.ToolIcon__keybinding,.HintViewer {display: none;}}- }- &.theme--dark .App-toolbar .ToolIcon:active {- --icon-fill-color: #{$oc-gray-3};- --keybinding-color: #{$oc-gray-3};+ &__divider {+ width: 1px;+ height: 1.5rem;+ align-self: center;+ background-color: var(--default-border-color);+ margin: 0 0.5rem;+ }}}diff --git a/src/components/UserList.scss b/src/components/UserList.scssindex 139d1b2dc0..89740aef7b 100644--- a/src/components/UserList.scss+++ b/src/components/UserList.scss@@ -7,23 +7,30 @@display: flex;flex-wrap: wrap;justify-content: flex-end;+ gap: 0.625rem;&:empty {display: none;}++ // can fit max 5 avatars in a column+ max-height: 140px;++ // can fit max 10 avatars in a row when there's enough space+ max-width: 290px;++ // Tweak in 30px increments to fit more/fewer avatars in a row/column ^^++ overflow: hidden;}.UserList > * {pointer-events: all;- margin: 0 0 var(--space-factor) var(--space-factor);}.UserList_mobile {padding: 0;justify-content: normal;- }-- .UserList_mobile > * {- margin: 0 var(--space-factor) var(--space-factor) 0;+ margin: 0.5rem 0;}}diff --git a/src/components/UserList.tsx b/src/components/UserList.tsxindex b9f7a36a08..468f1debbf 100644--- a/src/components/UserList.tsx+++ b/src/components/UserList.tsx@@ -44,6 +44,26 @@ export const UserList: React.FC<{);});+ // TODO barnabasmolnar/editor-redesign+ // probably remove before shipping :)+ // 20 fake collaborators; for easy, convenient debug purposes ˇˇ+ // const avatars = Array.from({ length: 20 }).map((_, index) => {+ // const avatarJSX = actionManager.renderAction("goToCollaborator", [+ // index.toString(),+ // {+ // username: `User ${index}`,+ // },+ // ]);++ // return mobile ? (+ // <Tooltip label={`User ${index}`} key={index}>+ // {avatarJSX}+ // </Tooltip>+ // ) : (+ // <React.Fragment key={index}>{avatarJSX}</React.Fragment>+ // );+ // });+return (<div className={clsx("UserList", className, { UserList_mobile: mobile })}>{avatars}diff --git a/src/components/WelcomeScreen.scss b/src/components/WelcomeScreen.scssnew file mode 100644index 0000000000..0ccb638085--- /dev/null+++ b/src/components/WelcomeScreen.scss@@ -0,0 +1,273 @@+.excalidraw {+ .virgil {+ font-family: "Virgil";+ }++ .WelcomeScreen-logo {+ display: flex;+ align-items: center;+ column-gap: 0.75rem;+ font-size: 2.25rem;++ svg {+ width: 1.625rem;+ height: auto;+ }+ }++ .WelcomeScreen-decor {+ pointer-events: none;++ color: var(--color-gray-40);++ &--subheading {+ font-size: 1.125rem;+ text-align: center;+ }++ &--help-pointer {+ display: flex;+ position: absolute;+ right: 0;+ bottom: 100%;++ :root[dir="rtl"] & {+ left: 0;+ right: auto;+ }++ svg {+ margin-top: 0.5rem;+ width: 85px;+ height: 71px;++ transform: scaleX(-1) rotate(80deg);++ :root[dir="rtl"] & {+ transform: rotate(80deg);+ }+ }+ }++ &--top-toolbar-pointer {+ position: absolute;+ top: 100%;+ left: 50%;+ transform: translateX(-50%);+ margin-top: 2.5rem;+ display: flex;+ align-items: baseline;++ &__label {+ width: 120px;+ position: relative;+ top: -0.5rem;+ }++ svg {+ width: 38px;+ height: 78px;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }+ }+ }++ &--menu-pointer {+ position: absolute;+ width: 320px;+ font-size: 1rem;++ top: 100%;+ margin-top: 0.25rem;+ margin-inline-start: 0.6rem;++ display: flex;+ align-items: flex-end;+ gap: 0.5rem;++ svg {+ width: 41px;+ height: 94px;++ :root[dir="rtl"] & {+ transform: scaleX(-1);+ }+ }+ }+ }++ .WelcomeScreen-container {+ display: flex;+ flex-direction: column;+ gap: 2rem;+ justify-content: center;+ align-items: center;+ position: absolute;+ pointer-events: none;+ left: 1rem;+ top: 1rem;+ right: 1rem;+ bottom: 1rem;+ }++ .WelcomeScreen-items {+ display: flex;+ flex-direction: column;+ gap: 2px;+ justify-content: center;+ align-items: center;+ }++ .WelcomeScreen-item {+ box-sizing: border-box;++ pointer-events: all;++ color: var(--color-gray-50);+ font-size: 0.875rem;++ min-width: 300px;+ display: flex;+ align-items: center;+ justify-content: space-between;++ background: none;+ border: none;++ padding: 0.75rem;++ border-radius: var(--border-radius-md);++ &__label {+ display: flex;+ align-items: center;+ column-gap: 0.5rem;++ svg {+ width: var(--default-icon-size);+ height: var(--default-icon-size);+ }+ }++ &__shortcut {+ color: var(--color-gray-40);+ font-size: 0.75rem;+ }+ }++ &:not(:active) .WelcomeScreen-item:hover {+ text-decoration: none;+ background: var(--color-gray-10);++ .WelcomeScreen-item__shortcut {+ color: var(--color-gray-50);+ }++ .WelcomeScreen-item__label {+ color: var(--color-gray-100);+ }+ }++ .WelcomeScreen-item:active {+ background: var(--color-gray-20);++ .WelcomeScreen-item__shortcut {+ color: var(--color-gray-50);+ }++ .WelcomeScreen-item__label {+ color: var(--color-gray-100);+ }++ &--promo {+ color: var(--color-promo) !important;++ &:hover {+ .WelcomeScreen-item__label {+ color: var(--color-promo) !important;+ }+ }+ }+ }++ &.theme--dark {+ .WelcomeScreen-decor {+ color: var(--color-gray-60);+ }++ .WelcomeScreen-item {+ color: var(--color-gray-60);++ &__shortcut {+ color: var(--color-gray-60);+ }+ }++ &:not(:active) .WelcomeScreen-item:hover {+ background: var(--color-gray-85);++ .WelcomeScreen-item__shortcut {+ color: var(--color-gray-50);+ }++ .WelcomeScreen-item__label {+ color: var(--color-gray-10);+ }+ }++ .WelcomeScreen-item:active {+ background-color: var(--color-gray-90);+ .WelcomeScreen-item__label {+ color: var(--color-gray-10);+ }+ }+ }++ // Can tweak these values but for an initial effort, it looks OK to me+ @media (max-width: 1024px) {+ .WelcomeScreen-decor {+ &--help-pointer,+ &--menu-pointer {+ display: none;+ }+ }+ }++ // @media (max-height: 400px) {+ // .WelcomeScreen-container {+ // margin-top: 0;+ // }+ // }+ @media (max-height: 599px) {+ .WelcomeScreen-container {+ margin-top: 4rem;+ }+ }+ @media (min-height: 600px) and (max-height: 900px) {+ .WelcomeScreen-container {+ margin-top: 8rem;+ }+ }+ @media (max-height: 630px) {+ .WelcomeScreen-decor--top-toolbar-pointer {+ display: none;+ }+ }+ @media (max-height: 500px) {+ .WelcomeScreen-container {+ display: none;+ }+ }++ // @media (max-height: 740px) {+ // .WelcomeScreen-decor {+ // &--help-pointer,+ // &--top-toolbar-pointer,+ // &--menu-pointer {+ // display: none;+ // }+ // }+ // }+}diff --git a/src/components/WelcomeScreen.tsx b/src/components/WelcomeScreen.tsxnew file mode 100644index 0000000000..03eb05855c--- /dev/null+++ b/src/components/WelcomeScreen.tsx@@ -0,0 +1,131 @@+import { useAtom } from "jotai";+import { actionLoadScene, actionShortcuts } from "../actions";+import { ActionManager } from "../actions/manager";+import { getShortcutFromShortcutName } from "../actions/shortcuts";+import { COOKIES } from "../constants";+import { collabDialogShownAtom } from "../excalidraw-app/collab/Collab";+import { t } from "../i18n";+import {+ ExcalLogo,+ HelpIcon,+ LoadIcon,+ PlusPromoIcon,+ UsersIcon,+} from "./icons";+import "./WelcomeScreen.scss";++const isExcalidrawPlusSignedUser = document.cookie.includes(+ COOKIES.AUTH_STATE_COOKIE,+);++const WelcomeScreenItem = ({+ label,+ shortcut,+ onClick,+ icon,+ link,+}: {+ label: string;+ shortcut: string | null;+ onClick?: () => void;+ icon: JSX.Element;+ link?: string;+}) => {+ if (link) {+ return (+ <a+ className="WelcomeScreen-item"+ href={link}+ target="_blank"+ rel="noreferrer"+ >+ <div className="WelcomeScreen-item__label">+ {icon}+ {label}+ </div>+ </a>+ );+ }++ return (+ <button className="WelcomeScreen-item" type="button" onClick={onClick}>+ <div className="WelcomeScreen-item__label">+ {icon}+ {label}+ </div>+ {shortcut && (+ <div className="WelcomeScreen-item__shortcut">{shortcut}</div>+ )}+ </button>+ );+};++const WelcomeScreen = ({ actionManager }: { actionManager: ActionManager }) => {+ const [, setCollabDialogShown] = useAtom(collabDialogShownAtom);++ let subheadingJSX;++ if (isExcalidrawPlusSignedUser) {+ subheadingJSX = t("welcomeScreen.switchToPlusApp")+ .split(/(Excalidraw\+)/)+ .map((bit) => {+ if (bit === "Excalidraw+") {+ return (+ <a+ style={{ pointerEvents: "all" }}+ href={`${process.env.REACT_APP_PLUS_APP}?utm_source=excalidraw&utm_medium=app&utm_content=welcomeScreenSignedInUser`}+ >+ Excalidraw++ </a>+ );+ }+ return bit;+ });+ } else {+ subheadingJSX = t("welcomeScreen.data");+ }++ return (+ <div className="WelcomeScreen-container">+ <div className="WelcomeScreen-logo virgil WelcomeScreen-decor">+ {ExcalLogo} Excalidraw+ </div>+ <div className="virgil WelcomeScreen-decor WelcomeScreen-decor--subheading">+ {subheadingJSX}+ </div>+ <div className="WelcomeScreen-items">+ <WelcomeScreenItem+ // TODO barnabasmolnar/editor-redesign+ // do we want the internationalized labels here that are currently+ // in use elsewhere or new ones?+ label={t("buttons.load")}+ onClick={() => actionManager.executeAction(actionLoadScene)}+ shortcut={getShortcutFromShortcutName("loadScene")}+ icon={LoadIcon}+ />+ <WelcomeScreenItem+ label={t("labels.liveCollaboration")}+ shortcut={null}+ onClick={() => setCollabDialogShown(true)}+ icon={UsersIcon}+ />+ <WelcomeScreenItem+ onClick={() => actionManager.executeAction(actionShortcuts)}+ label={t("helpDialog.title")}+ shortcut="?"+ icon={HelpIcon}+ />+ {!isExcalidrawPlusSignedUser && (+ <WelcomeScreenItem+ link="https://plus.excalidraw.com/plus?utm_source=excalidraw&utm_medium=app&utm_content=welcomeScreenGuest"+ label="Try Excalidraw Plus!"+ shortcut={null}+ icon={PlusPromoIcon}+ />+ )}+ </div>+ </div>+ );+};++export default WelcomeScreen;diff --git a/src/components/WelcomeScreenDecor.tsx b/src/components/WelcomeScreenDecor.tsxnew file mode 100644index 0000000000..1c7d6cc815--- /dev/null+++ b/src/components/WelcomeScreenDecor.tsx@@ -0,0 +1,11 @@+import { ReactNode } from "react";++const WelcomeScreenDecor = ({+ children,+ shouldRender,+}: {+ children: ReactNode;+ shouldRender: boolean;+}) => (shouldRender ? <>{children}</> : null);++export default WelcomeScreenDecor;diff --git a/src/components/icons.tsx b/src/components/icons.tsxindex 9e0ce7e843..fb438eff8f 100644--- a/src/components/icons.tsx+++ b/src/components/icons.tsx@@ -13,9 +13,6 @@ import clsx from "clsx";import { Theme } from "../element/types";import { THEME } from "../constants";-const activeElementColor = (theme: Theme) =>- theme === THEME.LIGHT ? oc.orange[4] : oc.orange[9];-const iconFillColor = (theme: Theme) => "var(--icon-fill-color)";const handlerColor = (theme: Theme) =>@@ -36,6 +33,7 @@ export const createIcon = (height = width,mirror,style,+ ...rest} = typeof opts === "number" ? ({ width: opts } as Opts) : opts;return (<svg@@ -45,12 +43,451 @@ export const createIcon = (viewBox={`0 0 ${width} ${height}`}className={clsx({ "rtl-mirror": mirror })}style={style}+ {...rest}>{typeof d === "string" ? <path fill="currentColor" d={d} /> : d}</svg>);};+const tablerIconProps: Opts = {+ width: 24,+ height: 24,+ fill: "none",+ strokeWidth: 2,+ stroke: "currentColor",+ strokeLinecap: "round",+ strokeLinejoin: "round",+} as const;++const modifiedTablerIconProps: Opts = {+ width: 20,+ height: 20,+ fill: "none",+ stroke: "currentColor",+ strokeLinecap: "round",+ strokeLinejoin: "round",+} as const;++// -----------------------------------------------------------------------------++// tabler-icons: present+export const PlusPromoIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x={3} y={8} width={18} height={4} rx={1} />+ <line x1={12} y1={8} x2={12} y2={21} />+ <path d="M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7" />+ <path d="M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5" />+ </g>,+ tablerIconProps,+);++// tabler-icons: book+export const LibraryIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />+ <path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />+ <line x1="3" y1="6" x2="3" y2="19" />+ <line x1="12" y1="6" x2="12" y2="19" />+ <line x1="21" y1="6" x2="21" y2="19" />+ </g>,+ tablerIconProps,+);++// tabler-icons: plus+export const PlusIcon = createIcon(+ <svg strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="12" y1="5" x2="12" y2="19" />+ <line x1="5" y1="12" x2="19" y2="12" />+ </svg>,+ tablerIconProps,+);++// tabler-icons: dots-vertical+export const DotsIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <circle cx="12" cy="12" r="1"></circle>+ <circle cx="12" cy="19" r="1"></circle>+ <circle cx="12" cy="5" r="1"></circle>+ </g>,+ tablerIconProps,+);++// tabler-icons: pinned+export const PinIcon = createIcon(+ <svg strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M9 4v6l-2 4v2h10v-2l-2 -4v-6"></path>+ <line x1="12" y1="16" x2="12" y2="21"></line>+ <line x1="8" y1="4" x2="16" y2="4"></line>+ </svg>,+ tablerIconProps,+);++// tabler-icons: lock-open (via Figma)+export const UnlockedIcon = createIcon(+ <g>+ <path+ d="M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ <path+ d="M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ <mask+ id="UnlockedIcon"+ style={{ maskType: "alpha" }}+ maskUnits="userSpaceOnUse"+ x={6}+ y={1}+ width={9}+ height={9}+ >+ <path+ stroke="none"+ d="M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481"+ fill="#fff"+ />+ </mask>+ <g mask="url(#UnlockedIcon)">+ <path+ stroke="none"+ d="M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z"+ fill="currentColor"+ />+ </g>+ </g>,+ modifiedTablerIconProps,+);++// tabler-icons: lock (via Figma)+export const LockedIcon = createIcon(+ <g strokeWidth="1.25">+ <path d="M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z" />+ <path d="M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z" />+ <path d="M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916" />+ </g>,+ modifiedTablerIconProps,+);++// custom+export const WelcomeScreenMenuArrow = createIcon(+ <>+ <path+ d="M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z"+ fill="currentColor"+ />+ <path+ d="M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ </>,+ { width: 41, height: 94, fill: "none" },+);++// custom+export const WelcomeScreenHelpArrow = createIcon(+ <>+ <path+ d="M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z"+ fill="currentColor"+ />+ <path+ d="M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ </>,+ { width: 85, height: 71, fill: "none" },+);++// custom+export const WelcomeScreenTopToolbarArrow = createIcon(+ <>+ <path+ d="M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z"+ fill="currentColor"+ />+ <path+ d="M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ />+ </>,+ { width: 38, height: 78, fill: "none" },+);++// custom+export const ExcalLogo = createIcon(+ <g fill="currentColor">+ <path d="M24.296 12.214c0 .112-.134.224-.291.224-.135 0-.516.629-.808 1.392-.897 2.335-9.867 20.096-9.89 19.534 0-.292-.134-.494-.359-.494-.313 0-.358.18-.224 1.055.135 1.01.045 1.236-3.14 7.432-1.793 3.525-3.722 7.208-4.282 8.196-.584 1.032-1.032 2.155-1.077 2.626-.067.809.022.92 1.973 2.605 1.122.988 2.557 2.223 3.185 2.784 2.826 2.582 4.149 3.615 4.508 3.547.538-.09 8.858-8.823 8.88-9.317 0-.225-.403-3.638-.897-7.59-.852-6.735-1.66-14.616-1.57-15.38.068-.47-.269-2.85-.516-3.884-.201-.808-.112-1.145 1.503-4.827.942-2.178 2.176-4.85 2.714-5.928.515-1.077.964-2.02.964-2.088 0-.067-.157-.112-.336-.112-.18 0-.337.09-.337.225Zm-5.158 16.772c.247 1.572.74 5.344 1.099 8.375.695 5.568 1.503 11.742 1.727 13.314.135.786.045.943-1.413 2.56-2.534 2.851-5.225 5.658-6.145 6.376l-.852.674-4.373-4.086c-4.037-3.728-4.373-4.11-4.127-4.558a5154.2 5154.2 0 0 1 2.535-4.626 727.864 727.864 0 0 0 3.678-6.78c.784-1.46 1.502-2.717 1.637-2.785.156-.09.201 2.178.156 7.006-.09 7.207-.067 7.23.651 7.072.09 0 .157-3.637.157-8.06V35.43l2.355-4.715c1.3-2.605 2.377-4.693 2.422-4.67.045.022.27 1.347.493 2.94ZM9.562 1.818C7.903 3.143 5.346 5.388 3.328 7.32L1.735 8.823l.292 1.976c.157 1.078.449 3.188.628 4.67.202 1.482.404 2.874.47 3.077.09.269 0 .404-.246.404-.426 0-.449-.113.718 3.592.286.952.577 1.903.875 2.851.044.158.224.225.425.158.202-.09.314-.27.247-.427-.067-.18.045-.36.224-.427.247-.09.225-.269-.157-.92-.605-1.01-2.152-9.633-2.242-12.416-.067-1.976-.067-1.999.762-3.121.808-1.1 2.67-2.762 5.54-4.873.807-.605 1.614-1.28 1.839-1.504.336-.404.493-.292 3.319 2.717 1.637 1.729 3.453 3.502 4.037 3.952l1.076.808-.83 1.75c-.448.944-2.265 4.581-4.059 8.04-3.745 7.274-2.983 6.578-7.333 6.645l-2.826.023-.942 1.077c-.987 1.146-1.121 1.572-.65 2.29.18.248.313.652.313.898 0 .405.157.472 1.055.517.56.023 1.076.09 1.144.157.067.068.156 1.46.224 3.098l.09 2.965-1.503 3.232C1.735 45.422.749 47.891.749 48.7c0 .427.09.786.18.786.224 0 .224-.022 9.35-19.085a4398.495 4398.495 0 0 1 8.927-18.546c.672-1.369 1.278-2.626 1.323-2.806.045-.202-1.503-1.751-3.97-3.93-2.22-1.975-4.171-3.772-4.35-3.974-.516-.628-1.279-.426-2.647.674ZM8.441 31.231c-.18.472-.65 1.46-1.031 2.2-.629 1.258-.696 1.303-.853.786-.09-.314-.157-1.235-.18-2.066-.022-1.639-.067-1.616 1.817-1.728L8.8 30.4l-.358.831Zm1.884-3.592c-1.032 1.998-1.077 2.02-3.903 2.155-2.489.135-2.533.112-2.533-.36 0-.269-.09-.628-.203-.808-.134-.202-.044-.56.27-1.055l.493-.763H6.69c1.234-.023 2.647-.113 3.14-.202.494-.09.92-.135.965-.113.045.023-.18.54-.471 1.146Zm-.09-20.477c-.404.292-.516.584-.516 1.325 0 .875.067 1.01.673 1.257.605.247.763.224 1.458-.247.92-.629.941-.786.269-1.796-.583-.876-1.166-1.033-1.884-.54Z" />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M23.703 11.793c.166-.291.501-.514.93-.514.38 0 .698.161.82.283.161.162.225.35.225.54a.822.822 0 0 1-.056.289c-.08.218-.5 1.106-.983 2.116-.535 1.071-1.76 3.727-2.699 5.895-.79 1.802-1.209 2.784-1.404 3.416-.142.461-.132.665-.058.961.264 1.103.6 3.647.53 4.132-.088.756.727 8.547 1.57 15.21.5 3.997.903 7.45.903 7.676l-.001.033c-.004.087-.041.288-.211.54-.24.354-.914 1.143-1.8 2.119-2.004 2.21-5.107 5.423-6.463 6.653-.322.292-.566.485-.696.56a.884.884 0 0 1-.289.111c-.194.037-.579-.007-1.11-.349-.707-.453-1.981-1.522-4-3.366-.627-.561-2.061-1.794-3.176-2.776-.81-.699-1.308-1.138-1.612-1.466-.32-.343-.47-.61-.549-.87-.078-.257-.085-.515-.055-.874.05-.52.521-1.769 1.166-2.91.559-.985 2.48-4.654 4.269-8.17 1.579-3.071 2.392-4.663 2.792-5.612.32-.759.329-1 .277-1.387-.085-.553-.092-.891-.052-1.092a.942.942 0 0 1 .274-.52c.164-.157.384-.261.704-.261.094 0 .184.011.27.033 1.924-3.44 8.554-16.632 9.316-18.616.276-.724.64-1.336.848-1.556a.965.965 0 0 1 .32-.228Zm-5.399 16.402c-.49.942-.971 1.888-1.446 2.837l-2.28 4.565v7.871c0 4.023-.06 7.404-.136 8.04-.067.552-.474.691-.654.722l.075-.008c-.317.07-.574.063-.778-.023-.234-.098-.5-.297-.63-.857-.156-.681-.158-2.462-.103-6.893.019-2.022.022-3.592.008-4.725-.156.276-.315.562-.467.843a737.624 737.624 0 0 1-3.682 6.79 3618.972 3618.972 0 0 0-2.462 4.493c.062.088.169.231.289.364.55.61 1.631 1.623 3.624 3.462l3.931 3.674.377-.298c.907-.709 3.554-3.479 6.055-6.293.425-.47.73-.814.946-1.084.175-.22.28-.36.319-.501.031-.117.002-.227-.024-.379l-.004-.02c-.224-1.572-1.032-7.753-1.728-13.33-.358-3.022-.85-6.782-1.096-8.349l-.002-.01c-.042-.301-.087-.603-.132-.891ZM9.118 1.264C9.91.628 10.537.27 11.028.144c.727-.186 1.27.003 1.713.53.186.209 2.107 1.972 4.287 3.912 2.02 1.783 3.434 3.16 3.897 3.743.326.41.322.756.296.873a1.046 1.046 0 0 1-.005.018c-.047.188-.669 1.512-1.374 2.947a4348.55 4348.55 0 0 0-8.923 18.54c-7.335 15.32-8.808 18.396-9.217 19.015-.235.355-.419.404-.525.437a.815.815 0 0 1-.249.036.745.745 0 0 1-.647-.363C.176 49.67.04 49.222.04 48.7c0-.286.09-.754.316-1.434.452-1.356 1.466-3.722 3.225-7.53l1.432-3.083-.084-2.787a72.902 72.902 0 0 0-.156-2.53 7.307 7.307 0 0 0-.539-.046c-.463-.024-.764-.062-.96-.124-.304-.096-.48-.252-.598-.438-.105-.165-.17-.374-.17-.663 0-.134-.081-.348-.178-.481l-.019-.028c-.293-.448-.406-.831-.373-1.234.04-.484.34-1.052 1.08-1.91l.759-.869c-.103-.325-.471-1.513-.854-2.787-.737-2.339-1.004-3.238-1.018-3.578-.016-.393.134-.59.27-.715a.721.721 0 0 1 .192-.125 89.87 89.87 0 0 1-.414-2.782 231.651 231.651 0 0 0-.625-4.652l-.292-1.976a.71.71 0 0 1 .215-.62l1.589-1.501C4.87 4.86 7.446 2.599 9.118 1.264Zm-1.833 33.75a.819.819 0 0 1-.406.208.73.73 0 0 1-.491-.063l.048 1.618v.009l.849-1.773Zm5.874.697c-.035.087-.07.175-.107.261a20.92 20.92 0 0 1-.36.798.688.688 0 0 1 .457.007l.01.004v-1.07Zm.72-1.892-.015.018a.745.745 0 0 1-.407.236c.02.195.027.378 0 .592l.422-.846ZM7.7 31.175c-.268.027-.489.055-.6.07-.006.056-.013.13-.016.194-.005.19 0 .42.004.694.003.111.006.225.011.338.232-.471.459-.956.6-1.296Zm2.12-1.456a2.04 2.04 0 0 1-.415.31c.064.104.099.222.104.341l.132-.277.18-.374Zm-.14-2.374c-.654.079-1.882.153-2.974.173h-1.87l-.281.435c-.09.141-.17.331-.203.414.102.21.189.508.226.788h.007c.364.006.928-.023 1.805-.07 1.243-.06 1.88-.052 2.315-.291.154-.086.266-.215.387-.393.176-.261.354-.605.587-1.056Zm2.136-1.784c-.157.16-.331.3-.52.422a.631.631 0 0 1 .182.281l.337-.703Zm7.205-1.478c-.222.442-.445.883-.667 1.32a.787.787 0 0 1 .61.007c.036.018.145.07.243.2-.032-.165-.067-.33-.105-.493-.088-.351-.137-.633-.08-1.034h-.001ZM11.415 2.546c-.358.319-1.039.879-1.725 1.394C6.903 5.989 5.087 7.59 4.301 8.662c-.28.38-.458.605-.556.852-.15.38-.103.798-.068 1.824.063 1.923.833 6.669 1.493 9.686.262 1.199.483 2.11.654 2.394.25.426.364.71.398.894a.923.923 0 0 1-.184.764l1.27-.01c.863-.014 1.523.003 2.056-.019.424-.017.75-.052 1.034-.187.336-.159.596-.458.921-.955.62-.948 1.373-2.515 2.705-5.103 1.789-3.448 3.6-7.076 4.047-8.015l.582-1.227-.62-.466c-.595-.458-2.45-2.263-4.12-4.027a59.654 59.654 0 0 0-2.498-2.52ZM5.81 24.876v-.001l-.013-.03.013.031Zm-.71-.835.027-.011a.55.55 0 0 0-.028.011Zm19.904-11.777v.01-.01Zm.002-.016v-.034.034ZM9.82 6.587c-.587.424-.81.823-.81 1.9 0 .787.12 1.157.344 1.42.158.186.388.339.77.494.352.144.603.207.838.209.347.002.688-.12 1.285-.525.707-.483.98-.864 1.036-1.238.052-.352-.09-.812-.574-1.54-.412-.619-.853-.95-1.29-1.072-.489-.139-1.016-.05-1.586.342l-.013.01Zm2.015 2.028a6.288 6.288 0 0 0-.306-.52c-.19-.284-.326-.488-.531-.5-.113-.007-.224.058-.352.146-.218.159-.218.34-.218.745 0 .198.02.419.028.504.047.025.133.068.204.097.133.054.222.102.312.103.04 0 .071-.027.12-.054a4.29 4.29 0 0 0 .358-.225c.147-.1.299-.223.385-.296ZM9.12 1.263l-.002.002.002-.002Z"+ />+ </g>,+ { width: 26, height: 62, fill: "none" },+);++// custom+export const SelectionIcon = createIcon(+ <g stroke="currentColor" strokeLinecap="round" strokeLinejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z" />+ <path d="M13.5 13.5l4.5 4.5" />+ </g>,+ { fill: "none", width: 22, height: 22, strokeWidth: 1.25 },+);++// tabler-icons: square+export const RectangleIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x="4" y="4" width="16" height="16" rx="2"></rect>+ </g>,+ tablerIconProps,+);++// tabler-icons: square-rotated+export const DiamondIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z" />+ </g>,++ tablerIconProps,+);++// tabler-icons: circle+export const EllipseIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <circle cx="12" cy="12" r="9"></circle>+ </g>,++ tablerIconProps,+);++// tabler-icons: arrow-narrow-right+export const ArrowIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="5" y1="12" x2="19" y2="12" />+ <line x1="15" y1="16" x2="19" y2="12" />+ <line x1="15" y1="8" x2="19" y2="12" />+ </g>,+ tablerIconProps,+);++// custom?+export const LineIcon = createIcon(+ <path d="M4.167 10h11.666" strokeWidth="1.5" />,+ modifiedTablerIconProps,+);++export const PenModeIcon = createIcon(+ <g strokeWidth="1.25">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"></path>+ <path d="M16 7h4"></path>+ <path d="M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"></path>+ </g>,+ tablerIconProps,+);++// modified tabler-icons: pencil+export const FreedrawIcon = createIcon(+ <g strokeWidth="1.25">+ <path+ clipRule="evenodd"+ d="m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"+ />+ <path d="m11.25 5.417 3.333 3.333" />+ </g>,++ modifiedTablerIconProps,+);++// tabler-icons: typography+export const TextIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="20" x2="7" y2="20" />+ <line x1="14" y1="20" x2="21" y2="20" />+ <line x1="6.9" y1="15" x2="13.8" y2="15" />+ <line x1="10.2" y1="6.3" x2="16" y2="20" />+ <polyline points="5 20 11 4 13 4 20 20"></polyline>+ </g>,+ tablerIconProps,+);++// modified tabler-icons: photo+export const ImageIcon = createIcon(+ <g strokeWidth="1.25">+ <path d="M12.5 6.667h.01" />+ <path d="M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z" />+ <path d="m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166" />+ <path d="m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667" />+ </g>,+ modifiedTablerIconProps,+);++// tabler-icons: eraser+export const EraserIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3" />+ <path d="M18 13.3l-6.3 -6.3" />+ </g>,+ tablerIconProps,+);++export const ZoomInIcon = createIcon(+ <path strokeWidth="1.25" d="M10 4.167v11.666M4.167 10h11.666" />,+ modifiedTablerIconProps,+);++export const ZoomOutIcon = createIcon(+ <path d="M5 10h10" strokeWidth="1.25" />,+ modifiedTablerIconProps,+);++export const TrashIcon = createIcon(+ <path+ strokeWidth="1.25"+ d="M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"+ />,+ modifiedTablerIconProps,+);++export const DuplicateIcon = createIcon(+ <g strokeWidth="1.25">+ <path d="M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z" />+ <path+ clipRule="evenodd"+ d="M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"+ />+ </g>,+ modifiedTablerIconProps,+);++export const MoonIcon = createIcon(+ <path+ clipRule="evenodd"+ d="M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z"+ stroke="currentColor"+ />,+ modifiedTablerIconProps,+);++export const SunIcon = createIcon(+ <g+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path d="M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667" />+ </g>,+ modifiedTablerIconProps,+);++export const HamburgerMenuIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <line x1="4" y1="6" x2="20" y2="6"></line>+ <line x1="4" y1="12" x2="20" y2="12"></line>+ <line x1="4" y1="18" x2="20" y2="18"></line>+ </g>,+ tablerIconProps,+);++export const ExportIcon = createIcon(+ <path+ strokeWidth="1.25"+ d="M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"+ />,+ modifiedTablerIconProps,+);++export const HelpIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <circle cx="12" cy="12" r="9"></circle>+ <line x1="12" y1="17" x2="12" y2="17.01"></line>+ <path d="M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"></path>+ </g>,+ tablerIconProps,+);++export const ExternalLinkIcon = createIcon(+ <path+ strokeWidth="1.25"+ d="M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"+ />,+ modifiedTablerIconProps,+);++export const GithubIcon = createIcon(+ <path+ d="M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,+);++export const DiscordIcon = createIcon(+ <g strokeWidth="1.25">+ <path d="M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0" />+ <path d="M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084" />+ </g>,+ modifiedTablerIconProps,+);++export const TwitterIcon = createIcon(+ <g strokeWidth="1.25">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"></path>+ </g>,+ tablerIconProps,+);+export const checkIcon = createIcon(<polyline fill="none" stroke="currentColor" points="20 6 9 17 4 12" />,{@@ -59,9 +496,12 @@ export const checkIcon = createIcon(},);-export const link = createIcon(- "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",- { mirror: true },+export const LinkIcon = createIcon(+ <g strokeWidth="1.25">+ <path d="M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416" />+ <path d="M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416" />+ </g>,+ modifiedTablerIconProps,);export const save = createIcon(@@ -74,9 +514,13 @@ export const saveAs = createIcon({ width: 448, height: 512 },);-export const load = createIcon(- "M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",- { width: 576, height: 512, mirror: true },+// tabler-icon: folder+export const LoadIcon = createIcon(+ <path+ d="m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,);export const clipboard = createIcon(@@ -84,27 +528,21 @@ export const clipboard = createIcon({ width: 384, height: 512 },);-export const trash = createIcon(- "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",-- { width: 448, height: 512 },-);-export const palette = createIcon("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z",);-export const exportFile = createIcon(- "M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",- { width: 576, height: 512, mirror: true },-);--export const exportImage = createIcon(- <>- <path d="M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z" />- <path d="M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z" />- </>,- { width: 576, height: 512, mirror: true },+export const ExportImageIcon = createIcon(+ <g strokeWidth="1.25">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M15 8h.01"></path>+ <path d="M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"></path>+ <path d="M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"></path>+ <path d="M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"></path>+ <path d="M19 16v6"></path>+ <path d="M22 19l-3 3l-3 -3"></path>+ </g>,+ tablerIconProps,);export const exportToFileIcon = createIcon(@@ -130,14 +568,20 @@ export const menu = createIcon("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z",);-export const undo = createIcon(- "M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",- { mirror: true },+export const UndoIcon = createIcon(+ <path+ d="M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,);-export const redo = createIcon(- "M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",- { mirror: true },+export const RedoIcon = createIcon(+ <path+ d="M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,);export const questionCircle = createIcon(@@ -146,8 +590,11 @@ export const questionCircle = createIcon();export const share = createIcon(- "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",- { width: 24, height: 24 },+ <path+ d="M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834"+ strokeWidth="1.5"+ />,+ modifiedTablerIconProps,);export const shareIOS = createIcon(@@ -158,7 +605,6 @@ export const shareIOS = createIcon(export const shareWindows = createIcon(<><path- stroke="currentColor"fill="currentColor"d="M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"/>@@ -183,84 +629,118 @@ export const resetZoom = createIcon({ width: 1024 },);-export const BringForwardIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>- <path- d="M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"- />+export const BringForwardIcon = createIcon(+ <>+ <g+ clipPath="url(#a)"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ ><path- d="M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"+ d="M13.889 4.167H8.333c-.767 0-1.389.622-1.389 1.389v5.555c0 .767.622 1.389 1.39 1.389h5.555c.767 0 1.389-.622 1.389-1.389V5.556c0-.767-.622-1.39-1.39-1.39Z"+ fill="currentColor"/>- </>,- { width: 24, mirror: true },- ),+ <path d="M12.5 12.5v1.389a1.389 1.389 0 0 1-1.389 1.389H5.556a1.389 1.389 0 0 1-1.39-1.39V8.334a1.389 1.389 0 0 1 1.39-1.389h1.388" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const SendBackwardIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const SendBackwardIcon = createIcon(+ <>+ <g+ clipPath="url(#a)"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ ><path- d="M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"+ fillRule="evenodd"+ clipRule="evenodd"+ d="M6.944 12.5H12.5v1.389a1.389 1.389 0 0 1-1.389 1.389H5.556a1.389 1.389 0 0 1-1.39-1.39V8.334a1.389 1.389 0 0 1 1.39-1.389h1.388"+ fill="currentColor"/>+ <path d="M13.889 4.167H8.333c-.767 0-1.389.621-1.389 1.389v5.555c0 .767.622 1.389 1.39 1.389h5.555c.767 0 1.389-.622 1.389-1.389V5.556c0-.768-.622-1.39-1.39-1.39Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,+);++export const BringToFrontIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M8.775 6.458h2.45a2.316 2.316 0 0 1 2.317 2.316v2.452a2.316 2.316 0 0 1-2.316 2.316H8.774a2.316 2.316 0 0 1-2.317-2.316V8.774a2.316 2.316 0 0 1 2.317-2.316Z"+ fill="currentColor"/>- </>,- { width: 24, mirror: true },- ),+ <path d="M5.441 9.792h2.451a2.316 2.316 0 0 1 2.316 2.316v2.45a2.316 2.316 0 0 1-2.316 2.317h-2.45a2.316 2.316 0 0 1-2.317-2.316v-2.451a2.316 2.316 0 0 1 2.316-2.316ZM12.108 3.125h2.45a2.316 2.316 0 0 1 2.317 2.316v2.451a2.316 2.316 0 0 1-2.316 2.316h-2.451a2.316 2.316 0 0 1-2.316-2.316v-2.45a2.316 2.316 0 0 1 2.316-2.317Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const BringToFrontIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const SendToBackIcon = createIcon(+ <>+ <g clipPath="url(#a)"><path- d="M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M5.441 9.792h2.451a2.316 2.316 0 0 1 2.316 2.316v2.45a2.316 2.316 0 0 1-2.316 2.317h-2.45a2.316 2.316 0 0 1-2.317-2.316v-2.451a2.316 2.316 0 0 1 2.316-2.316Z"+ stroke="currentColor"+ strokeWidth="1.25"/><path- d="M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"+ d="M5.441 9.792h2.451a2.316 2.316 0 0 1 2.316 2.316v2.45a2.316 2.316 0 0 1-2.316 2.317h-2.45a2.316 2.316 0 0 1-2.317-2.316v-2.451a2.316 2.316 0 0 1 2.316-2.316Z"+ stroke="currentColor"+ strokeWidth="1.25"/>- </>,- { width: 24, mirror: true },- ),-);--export const SendToBackIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+ <mask id="SendToBackIcon" fill="#fff">+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M9.167 5.833v2.06a2.941 2.941 0 0 0 2.94 2.94h2.06v.393a2.941 2.941 0 0 1-2.941 2.94h-.393v-2.058a2.941 2.941 0 0 0-2.94-2.941h-2.06v-.393a2.941 2.941 0 0 1 2.942-2.94h.392Z"+ />+ </mask><path- d="M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"+ fillRule="evenodd"+ clipRule="evenodd"+ d="M9.167 5.833v2.06a2.941 2.941 0 0 0 2.94 2.94h2.06v.393a2.941 2.941 0 0 1-2.941 2.94h-.393v-2.058a2.941 2.941 0 0 0-2.94-2.941h-2.06v-.393a2.941 2.941 0 0 1 2.942-2.94h.392Z"+ fill="currentColor"/><path- d="M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M9.167 5.833h1.25v-1.25h-1.25v1.25Zm5 5h1.25v-1.25h-1.25v1.25Zm-3.334 3.334h-1.25v1.25h1.25v-1.25Zm-5-5h-1.25v1.25h1.25v-1.25Zm2.084-3.334v2.06h2.5v-2.06h-2.5Zm0 2.06a4.191 4.191 0 0 0 4.19 4.19v-2.5a1.691 1.691 0 0 1-1.69-1.69h-2.5Zm4.19 4.19h2.06v-2.5h-2.06v2.5Zm.81-1.25v.393h2.5v-.393h-2.5Zm0 .393c0 .933-.758 1.69-1.691 1.69v2.5a4.191 4.191 0 0 0 4.19-4.19h-2.5Zm-1.691 1.69h-.393v2.5h.393v-2.5Zm.857 1.25v-2.058h-2.5v2.059h2.5Zm0-2.058a4.191 4.191 0 0 0-4.19-4.191v2.5c.933 0 1.69.757 1.69 1.69h2.5Zm-4.19-4.191h-2.06v2.5h2.06v-2.5Zm-.81 1.25v-.393h-2.5v.393h2.5Zm0-.393c0-.934.758-1.69 1.692-1.69v-2.5a4.191 4.191 0 0 0-4.192 4.19h2.5Zm1.692-1.69h.392v-2.5h-.392v2.5Z"+ fill="currentColor"+ mask="url(#SendToBackIcon)"/>- </>,- { width: 24, mirror: true },- ),+ <path+ d="M12.108 3.125h2.45a2.316 2.316 0 0 1 2.317 2.316v2.451a2.316 2.316 0 0 1-2.316 2.316h-2.451a2.316 2.316 0 0 1-2.316-2.316v-2.45a2.316 2.316 0 0 1 2.316-2.317Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);//@@ -269,181 +749,167 @@ export const SendToBackIcon = React.memo(({ theme }: { theme: Theme }) =>// first one the user sees. Horizontal align icons should not be flipped since// that would make them lie about their function.//-export const AlignTopIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const AlignTopIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M 2,5 H 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M3.333 3.333h13.334"strokeLinecap="round"+ strokeLinejoin="round"/>- <path- d="M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24, mirror: true },- ),+ <path d="M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const AlignBottomIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const AlignBottomIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M 2,19 H 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M3.333 16.667h13.334"strokeLinecap="round"+ strokeLinejoin="round"/>- <path- d="m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24, mirror: true },- ),+ <path d="M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const AlignLeftIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const AlignLeftIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M 5,2 V 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M3.333 3.333v13.334"strokeLinecap="round"+ strokeLinejoin="round"/>- <path- d="m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24 },- ),+ <path d="M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const AlignRightIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const AlignRightIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M 19,2 V 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"+ d="M16.667 3.333v13.334"strokeLinecap="round"+ strokeLinejoin="round"/>- <path- d="m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24 },- ),-);--export const DistributeHorizontallyIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <>- <path- d="M19 5V19M5 5V19"- stroke={iconFillColor(theme)}- strokeWidth="2"- strokeLinecap="round"- />- <path- d="M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24 },- ),+ <path d="M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const DistributeVerticallyIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <>- <path- d="M5 5L19 5M5 19H19"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"- strokeLinecap="round"- />- <path- d="M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- </>,- { width: 24 },- ),+export const DistributeHorizontallyIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25">+ <path+ d="M16.667 3.333v13.334M3.333 3.333v13.334"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path d="M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const CenterVerticallyIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const DistributeVerticallyIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z"- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"+ d="M3.333 3.333h13.334M3.333 16.667h13.334"+ strokeLinecap="round"+ strokeLinejoin="round"/>+ <path d="M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,+);++export const CenterVerticallyIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25"><path- d="M 2,12 H 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"- strokeDasharray="1, 2.8"+ d="M10 18.333v-2.916"strokeLinecap="round"+ strokeLinejoin="round"/>- </>,- { width: 24, mirror: true },- ),+ <path d="M10 11.667V8.333" strokeLinejoin="round" />+ <path d="M10 4.583V1.667" strokeLinecap="round" strokeLinejoin="round" />+ <path d="M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const CenterHorizontallyIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <>- <path- d="M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z "- fill={activeElementColor(theme)}- stroke={activeElementColor(theme)}- strokeWidth="2"- />- <path- d="M 12,2 V 22"- fill={iconFillColor(theme)}- stroke={iconFillColor(theme)}- strokeWidth="2"- strokeDasharray="1, 2.8"- strokeLinecap="round"- />- </>,- { width: 24 },- ),+export const CenterHorizontallyIcon = createIcon(+ <>+ <g clipPath="url(#a)" stroke="currentColor" strokeWidth="1.25">+ <path d="M1.667 10h2.916" strokeLinecap="round" strokeLinejoin="round" />+ <path d="M8.333 10h3.334" strokeLinejoin="round" />+ <path d="M15.417 10h2.916" strokeLinecap="round" strokeLinejoin="round" />+ <path d="M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const users = createIcon(- "M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",- { width: 640, height: 512, mirror: true },+export const UsersIcon = createIcon(+ <g strokeWidth="1.5">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <circle cx="9" cy="7" r="4"></circle>+ <path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"></path>+ <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>+ <path d="M21 21v-2a4 4 0 0 0 -3 -3.85"></path>+ </g>,+ tablerIconProps,);// not mirrored because it's inspired by a playback control, which is always RTL@@ -455,9 +921,24 @@ export const stop = createIcon("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z",);-export const close = createIcon(- "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",- { width: 352, height: 512 },+export const CloseIcon = createIcon(+ <>+ <g+ clipPath="url(#a)"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path d="M15 5 5 15M5 5l10 10" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);export const back = createIcon(@@ -481,6 +962,8 @@ export const file = createIcon({ width: 384, height: 512 },);+// TODO barnabasmolnar/editor-redesign+// couldn't find a new icon for thisexport const GroupIcon = React.memo(({ theme }: { theme: Theme }) =>createIcon(<>@@ -543,47 +1026,134 @@ export const UngroupIcon = React.memo(({ theme }: { theme: Theme }) =>),);-export const FillHachureIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(+export const FillHachureIcon = createIcon(+ <><path- fillRule="evenodd"- clipRule="evenodd"- d="M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"- fill={iconFillColor(theme)}- />,- { width: 40, height: 20 },- ),+ d="M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ <mask+ id="FillHachureIcon"+ style={{ maskType: "alpha" }}+ maskUnits="userSpaceOnUse"+ x={2}+ y={2}+ width={16}+ height={16}+ >+ <path+ d="M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ </mask>+ <g mask="url(#FillHachureIcon)">+ <path+ d="M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </g>+ </>,+ modifiedTablerIconProps,);-export const FillCrossHatchIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <g fill={iconFillColor(theme)} fillRule="evenodd" clipRule="evenodd">- <path d="M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z" />- <path d="M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z" />- </g>,- { width: 40, height: 20 },- ),+export const FillCrossHatchIcon = createIcon(+ <>+ <g clipPath="url(#a)">+ <path+ d="M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ <mask+ id="FillCrossHatchIcon"+ style={{ maskType: "alpha" }}+ maskUnits="userSpaceOnUse"+ x={-1}+ y={-1}+ width={22}+ height={22}+ >+ <path+ d="M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </mask>+ <g mask="url(#FillCrossHatchIcon)">+ <path+ d="M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z"+ fill="currentColor"+ />+ </g>+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const FillSolidIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(<path d="M2 2H38V18H2V2Z" fill={iconFillColor(theme)} />, {- width: 40,- height: 20,- }),+export const FillSolidIcon = createIcon(+ <>+ <g clipPath="url(#a)">+ <path+ d="M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"+ stroke="currentColor"+ strokeWidth="1.25"+ />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ { ...modifiedTablerIconProps, fill: "currentColor" },);-export const StrokeWidthIcon = React.memo(- ({ theme, strokeWidth }: { theme: Theme; strokeWidth: number }) =>- createIcon(- <path- d="M6 10H32"- stroke={iconFillColor(theme)}- strokeWidth={strokeWidth}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20 },- ),+export const StrokeWidthBaseIcon = createIcon(+ <>+ <path+ d="M4.167 10h11.666"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </>,+ modifiedTablerIconProps,+);++export const StrokeWidthBoldIcon = createIcon(+ <path+ d="M5 10h10"+ stroke="currentColor"+ strokeWidth="2.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />,+ modifiedTablerIconProps,+);++export const StrokeWidthExtraBoldIcon = createIcon(+ <path+ d="M5 10h10"+ stroke="currentColor"+ strokeWidth="3.75"+ strokeLinecap="round"+ strokeLinejoin="round"+ />,+ modifiedTablerIconProps,);export const StrokeStyleSolidIcon = React.memo(({ theme }: { theme: Theme }) =>@@ -602,122 +1172,110 @@ export const StrokeStyleSolidIcon = React.memo(({ theme }: { theme: Theme }) =>),);-export const StrokeStyleDashedIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M6 10H34"- stroke={iconFillColor(theme)}- strokeWidth={2.5}- strokeDasharray={"10, 8"}- fill="none"- strokeLinecap="round"- />,- { width: 40, height: 20 },- ),-);--export const StrokeStyleDottedIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M6 10H36"- stroke={iconFillColor(theme)}- strokeWidth={2.5}- strokeDasharray={"2, 4.5"}- fill="none"- strokeLinecap="round"- />,- { width: 40, height: 20 },- ),-);--export const SloppinessArchitectIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919"- stroke={iconFillColor(theme)}- strokeWidth={2}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20, mirror: true },- ),-);--export const SloppinessArtistIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13"- stroke={iconFillColor(theme)}- strokeWidth={2}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20, mirror: true },- ),+export const StrokeStyleDashedIcon = createIcon(+ <g strokeWidth="2">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M5 12h2" />+ <path d="M17 12h2" />+ <path d="M11 12h2" />+ </g>,+ tablerIconProps,);-export const SloppinessCartoonistIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244"- stroke={iconFillColor(theme)}- strokeWidth={2}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20, mirror: true },- ),+// tabler-icons: line-dotted+export const StrokeStyleDottedIcon = createIcon(+ <g strokeWidth="2">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M4 12v.01" />+ <path d="M8 12v.01" />+ <path d="M12 12v.01" />+ <path d="M16 12v.01" />+ <path d="M20 12v.01" />+ </g>,+ tablerIconProps,);-export const EdgeSharpIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M10 17L10 5L35 5"- stroke={iconFillColor(theme)}- strokeWidth={2}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20, mirror: true },- ),+export const SloppinessArchitectIcon = createIcon(+ <path+ d="M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,);-export const EdgeRoundIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M10 17V15C10 8 13 5 21 5L33.5 5"- stroke={iconFillColor(theme)}- strokeWidth={2}- strokeLinecap="round"- fill="none"- />,- { width: 40, height: 20, mirror: true },- ),+export const SloppinessArtistIcon = createIcon(+ <path+ d="M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,);-export const ArrowheadNoneIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M6 10H34"- stroke={iconFillColor(theme)}- strokeWidth={2}- fill="none"- />,- {- width: 40,- height: 20,- },- ),+export const SloppinessCartoonistIcon = createIcon(+ <path+ d="M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42"+ strokeWidth="1.25"+ />,+ modifiedTablerIconProps,+);++export const EdgeSharpIcon = createIcon(+ <svg strokeWidth="1.5">+ <path d="M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10" />+ <path d="M13.3333 3.33331V3.34331" />+ <path d="M16.6667 3.33331V3.34331" />+ <path d="M16.6667 6.66669V6.67669" />+ <path d="M16.6667 10V10.01" />+ <path d="M3.33334 13.3333V13.3433" />+ <path d="M16.6667 13.3333V13.3433" />+ <path d="M3.33334 16.6667V16.6767" />+ <path d="M6.66666 16.6667V16.6767" />+ <path d="M10 16.6667V16.6767" />+ <path d="M13.3333 16.6667V16.6767" />+ <path d="M16.6667 16.6667V16.6767" />+ </svg>,+ modifiedTablerIconProps,+);++// tabler-icons: border-radius+export const EdgeRoundIcon = createIcon(+ <g+ strokeWidth="1.5"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M4 12v-4a4 4 0 0 1 4 -4h4" />+ <line x1="16" y1="4" x2="16" y2="4.01" />+ <line x1="20" y1="4" x2="20" y2="4.01" />+ <line x1="20" y1="8" x2="20" y2="8.01" />+ <line x1="20" y1="12" x2="20" y2="12.01" />+ <line x1="4" y1="16" x2="4" y2="16.01" />+ <line x1="20" y1="16" x2="20" y2="16.01" />+ <line x1="4" y1="20" x2="4" y2="20.01" />+ <line x1="8" y1="20" x2="8" y2="20.01" />+ <line x1="12" y1="20" x2="12" y2="20.01" />+ <line x1="16" y1="20" x2="16" y2="20.01" />+ <line x1="20" y1="20" x2="20" y2="20.01" />+ </g>,+ tablerIconProps,+);++export const ArrowheadNoneIcon = createIcon(+ <path d="M6 10H34" stroke="currentColor" strokeWidth={2} fill="none" />,+ {+ width: 40,+ height: 20,+ },);export const ArrowheadArrowIcon = React.memo(- ({ theme, flip = false }: { theme: Theme; flip?: boolean }) =>+ ({ flip = false }: { flip?: boolean }) =>createIcon(<gtransform={flip ? "translate(40, 0) scale(-1, 1)" : ""}- stroke={iconFillColor(theme)}+ stroke="currentColor"strokeWidth={2}fill="none">@@ -729,11 +1287,11 @@ export const ArrowheadArrowIcon = React.memo();export const ArrowheadDotIcon = React.memo(- ({ theme, flip = false }: { theme: Theme; flip?: boolean }) =>+ ({ flip = false }: { flip?: boolean }) =>createIcon(<g- stroke={iconFillColor(theme)}- fill={iconFillColor(theme)}+ stroke="currentColor"+ fill="currentColor"transform={flip ? "translate(40, 0) scale(-1, 1)" : ""}><path d="M32 10L6 10" strokeWidth={2} />@@ -744,12 +1302,12 @@ export const ArrowheadDotIcon = React.memo();export const ArrowheadBarIcon = React.memo(- ({ theme, flip = false }: { theme: Theme; flip?: boolean }) =>+ ({ flip = false }: { flip?: boolean }) =>createIcon(<g transform={flip ? "translate(40, 0) scale(-1, 1)" : ""}><pathd="M34 10H5.99996M34 10L34 5M34 10L34 15"- stroke={iconFillColor(theme)}+ stroke="currentColor"strokeWidth={2}fill="none"/>@@ -759,11 +1317,11 @@ export const ArrowheadBarIcon = React.memo();export const ArrowheadTriangleIcon = React.memo(- ({ theme, flip = false }: { theme: Theme; flip?: boolean }) =>+ ({ flip = false }: { flip?: boolean }) =>createIcon(<g- stroke={iconFillColor(theme)}- fill={iconFillColor(theme)}+ stroke="currentColor"+ fill="currentColor"transform={flip ? "translate(40, 0) scale(-1, 1)" : ""}><path d="M32 10L6 10" strokeWidth={2} />@@ -773,149 +1331,211 @@ export const ArrowheadTriangleIcon = React.memo(),);-export const FontSizeSmallIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- fill={iconFillColor(theme)}- d="M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"- />,- { width: 47, height: 77 },- ),-);--export const FontSizeMediumIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- fill={iconFillColor(theme)}- d="M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"- />,- { width: 77, height: 75 },- ),-);--export const FontSizeLargeIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- fill={iconFillColor(theme)}- d="M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"- />,- { width: 45, height: 75 },- ),-);--export const FontSizeExtraLargeIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(- <path- fill={iconFillColor(theme)}- d="M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"- />,- { width: 120, height: 75 },- ),-);--export const FontFamilyHandDrawnIcon = React.memo(- ({ theme }: { theme: Theme }) =>- createIcon(+export const FontSizeSmallIcon = createIcon(+ <>+ <g clipPath="url(#a)"><path- fill={iconFillColor(theme)}- d="M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"- />,- { width: 448, height: 512 },- ),+ d="M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const FontFamilyNormalIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>- <path- fill={iconFillColor(theme)}- d="M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"- />+export const FontSizeMediumIcon = createIcon(+ <>+ <g clipPath="url(#a)"><path- fill={iconFillColor(theme)}- d="M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"+ d="M5 16.667V3.333L10 15l5-11.667v13.334"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"/>- </>,- { width: 70, height: 78 },- ),+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const FontFamilyCodeIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <>+export const FontSizeLargeIcon = createIcon(+ <>+ <g clipPath="url(#a)"><path- fill={iconFillColor(theme)}- d="M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"+ d="M5.833 3.333v13.334h8.334"+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"/>- </>,- { width: 640, height: 512 },- ),+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);-export const TextAlignLeftIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(+export const FontSizeExtraLargeIcon = createIcon(+ <><path- d="M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z"- fill={iconFillColor(theme)}+ d="m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666"+ stroke="currentColor"+ strokeWidth="1.25"strokeLinecap="round"- />,- { width: 448, height: 512 },- ),+ strokeLinejoin="round"+ />+ </>,+ modifiedTablerIconProps,);-export const TextAlignCenterIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z"- fill={iconFillColor(theme)}- />,- { width: 448, height: 512 },- ),+export const FontFamilyNormalIcon = createIcon(+ <>+ <g+ stroke="currentColor"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path d="M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334" />+ </g>+ </>,+ modifiedTablerIconProps,);-export const TextAlignRightIcon = React.memo(({ theme }: { theme: Theme }) =>- createIcon(- <path- d="M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z"- fill={iconFillColor(theme)}+export const FontFamilyCodeIcon = createIcon(+ <>+ <g+ clipPath="url(#a)"+ stroke="currentColor"+ strokeWidth="1.25"strokeLinecap="round"- />,- { width: 448, height: 512 },- ),+ strokeLinejoin="round"+ >+ <path d="M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667" />+ </g>+ <defs>+ <clipPath id="a">+ <path fill="#fff" d="M0 0h20v20H0z" />+ </clipPath>+ </defs>+ </>,+ modifiedTablerIconProps,);+export const TextAlignLeftIcon = createIcon(+ <g+ stroke="currentColor"+ fill="none"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth={2}+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="8" x2="20" y2="8" />+ <line x1="4" y1="12" x2="12" y2="12" />+ <line x1="4" y1="16" x2="16" y2="16" />+ </g>,+ tablerIconProps,+);++export const TextAlignCenterIcon = createIcon(+ <g+ stroke="currentColor"+ fill="none"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="8" x2="20" y2="8" />+ <line x1="8" y1="12" x2="16" y2="12" />+ <line x1="6" y1="16" x2="18" y2="16" />+ </g>,+ tablerIconProps,+);++export const TextAlignRightIcon = createIcon(+ <g+ stroke="currentColor"+ fill="none"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="8" x2="20" y2="8" />+ <line x1="10" y1="12" x2="20" y2="12" />+ <line x1="8" y1="16" x2="20" y2="16" />+ </g>,+ tablerIconProps,+);++// tabler-icons: layout-align-topexport const TextAlignTopIcon = React.memo(({ theme }: { theme: Theme }) =>createIcon(- <path- d="m16,132l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16zm0,160l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16z"- fill={iconFillColor(theme)}- strokeLinecap="round"- />,- { width: 448, height: 512 },+ <g+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="4" x2="20" y2="4" />+ <rect x="9" y="8" width="6" height="12" rx="2" />+ </g>,+ tablerIconProps,),);+// tabler-icons: layout-align-bottomexport const TextAlignBottomIcon = React.memo(({ theme }: { theme: Theme }) =>createIcon(- <path- d="M16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292ZM16,452L432,452C440.837,452 448,444.837 448,436L448,396C448,387.163 440.837,380 432,380L16,380C7.163,380 0,387.163 0,396L0,436C0,444.837 7.163,452 16,452Z"- fill={iconFillColor(theme)}- strokeLinecap="round"- />,- { width: 448, height: 512 },+ <g+ stroke-width="2"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="20" x2="20" y2="20" />+ <rect x="9" y="4" width="6" height="12" rx="2"></rect>+ </g>,+ tablerIconProps,),);+// tabler-icons: layout-align-middleexport const TextAlignMiddleIcon = React.memo(({ theme }: { theme: Theme }) =>createIcon(- <path- transform="matrix(1,0,0,1,0,80)"- d="M16,132L432,132C440.837,132 448,124.837 448,116L448,76C448,67.163 440.837,60 432,60L16,60C7.163,60 0,67.163 0,76L0,116C0,124.837 7.163,132 16,132ZM16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292Z"- fill={iconFillColor(theme)}- strokeLinecap="round"- />,- { width: 448, height: 512 },+ <g+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <line x1="4" y1="12" x2="9" y2="12" />+ <line x1="15" y1="12" x2="20" y2="12" />+ <rect x="9" y="6" width="6" height="12" rx="2" />+ </g>,+ tablerIconProps,),);@@ -927,14 +1547,6 @@ export const publishIcon = createIcon({ width: 640, height: 512 },);-export const editIcon = createIcon(- <path- fill="currentColor"- d="M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"- ></path>,- { width: 640, height: 512 },-);-export const eraser = createIcon(<path d="M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z" />,);diff --git a/src/css/styles.scss b/src/css/styles.scssindex 920f7e7aea..7bceb1ceae 100644--- a/src/css/styles.scss+++ b/src/css/styles.scss@@ -19,6 +19,10 @@height: 100%;width: 100%;+ button {+ cursor: pointer;+ }+&:focus {outline: none;}@@ -85,15 +89,16 @@.panelColumn {display: flex;flex-direction: column;+ row-gap: 0.75rem;h3,legend,.control-label {- margin-top: 0.333rem;- margin-bottom: 0.333rem;+ margin: 0;+ margin-bottom: 0.25rem;font-size: 0.75rem;color: var(--text-primary-color);- font-weight: bold;+ font-weight: normal;display: block;}@@ -102,12 +107,6 @@width: 100%;}- h3:first-child,- legend:first-child,- .control-label:first-child {- margin-top: 0;- }-legend {padding: 0;}@@ -119,11 +118,12 @@.buttonList {flex-wrap: wrap;+ display: flex;+ column-gap: 0.5rem;+ row-gap: 0.5rem;label {- margin-right: 0.25rem;font-size: 0.75rem;- display: inline-block;}input[type="radio"],@@ -136,38 +136,10 @@.iconRow {margin-top: 8px;}-- .ToolIcon {- margin: 0;- margin-inline-end: 8px;-- &:focus {- outline: transparent;- box-shadow: 0 0 0 2px var(--focus-highlight-color);- }-- &:hover {- background-color: var(--button-gray-2);- }-- &:active {- background-color: var(--button-gray-3);- }-- &:disabled {- cursor: not-allowed;- }- }-- .ToolIcon__icon {- width: 28px;- height: 28px;- }}fieldset {margin: 0;- margin-top: 0.333rem;padding: 0;border: none;}@@ -185,64 +157,26 @@box-shadow: 0 0 0 2px var(--focus-highlight-color);}- button,- .buttonList label {- user-select: none;- background-color: var(--button-gray-1);- border: 0;- border-radius: var(--border-radius-md);- margin: 0.125rem 0;- padding: 0.25rem;- white-space: nowrap;-- cursor: pointer;-- &:focus-visible {- outline: transparent;- box-shadow: 0 0 0 2px var(--focus-highlight-color);+ .buttonList {+ .ToolIcon__icon {+ all: unset !important;+ display: flex !important;}- &:hover {- background-color: var(--button-gray-2);+ button {+ background-color: transparent;}- &:active {- background-color: var(--button-gray-3);- }+ label,+ button,+ .zIndexButton {+ @include outlineButtonStyles;- &:disabled {- cursor: not-allowed;- }- }-- .active,- .buttonList label.active {- background-color: var(--color-primary);-- --icon-fill-color: #{$oc-white};-- &:hover {- background-color: var(--color-primary-darker);- }-- &:active {- background-color: var(--color-primary-darkest);- }- }+ padding: 0;- .buttonList.buttonListIcon {- label {- display: inline-flex;- justify-content: center;- align-items: center;svg {- width: 35px;- height: 14px;- padding: 2px;- opacity: 0.6;- }- &.active svg {- opacity: 1;+ width: var(--default-icon-size);+ height: var(--default-icon-size);}}}@@ -289,8 +223,6 @@.App-toolbar {width: 100%;- box-sizing: border-box;-.eraser {&.ToolIcon:hover {--icon-fill-color: #fff;@@ -322,12 +254,27 @@color: var(--icon-fill-color);}+ .shapes-section {+ display: flex;+ justify-content: center;+ pointer-events: none !important;++ & > * {+ pointer-events: all;+ }+ }+.App-menu_top {- grid-template-columns: auto max-content auto;- grid-gap: 4px;+ grid-template-columns: 1fr 2fr 1fr;+ grid-gap: 2rem;align-items: flex-start;cursor: default;pointer-events: none !important;++ @media (min-width: 1536px) {+ grid-template-columns: 1fr 1fr 1fr;+ grid-gap: 3rem;+ }}.layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top > * {@@ -344,20 +291,14 @@.App-menu_bottom {position: absolute;- bottom: 0;- grid-template-columns: min-content auto min-content;- grid-gap: 15px;+ bottom: 1rem;+ display: flex;+ justify-content: space-between;align-items: flex-start;cursor: default;pointer-events: none !important;-- :root[dir="ltr"] & {- left: 0.25rem;- }-- :root[dir="rtl"] & {- right: 0.25rem;- }+ box-sizing: border-box;+ padding: 0 1rem;&--transition-left {section {@@ -390,7 +331,10 @@.App-menu__left {overflow-y: auto;- box-shadow: var(--shadow-island);+ padding: 0.75rem;+ width: 202px;+ box-sizing: border-box;+ position: absolute;}.dropdown-select {@@ -426,55 +370,65 @@&:active {background-color: var(--button-gray-2);}++ &__language {+ height: 2rem;+ background-color: var(--island-bg-color);+ border-color: var(--default-border-color) !important;+ cursor: pointer;++ &:hover {+ background-color: var(--island-bg-color);+ }+ }}- .zIndexButton {- margin: 0;- margin-inline-end: 8px;- padding: 5px;- display: inline-flex;- align-items: center;- justify-content: center;+ .disable-zen-mode {+ border-radius: var(--border-radius-lg);+ background-color: var(--color-gray-20);+ border: 1px solid var(--color-gray-30);+ padding: 10px 20px;- svg {- width: 18px;- height: 18px;+ &:hover {+ background-color: var(--color-gray-30);}}.scroll-back-to-content {- color: var(--popup-text-color);+ border-radius: var(--border-radius-lg);+ background-color: var(--island-bg-color);+ color: var(--icon-fill-color);++ border: 1px solid var(--default-border-color);+ padding: 10px 20px;position: absolute;left: 50%;bottom: 30px;transform: translateX(-50%);- padding: 10px 20px;pointer-events: all;++ &:hover {+ background-color: var(--button-hover);+ }++ &:active {+ border: 1px solid var(--color-primary-darkest);+ }}.help-icon {- display: flex;- cursor: pointer;- fill: $oc-gray-6;- padding: 0;- margin: 0;- background: none;- color: var(--icon-fill-color);+ @include outlineButtonStyles;+ background-color: var(--island-bg-color);+ width: var(--lg-button-size);+ height: var(--lg-button-size);svg {- width: 1.5rem;- height: 1.5rem;- }-- &:hover {- background: none;+ width: var(--lg-icon-size);+ height: var(--lg-icon-size);}}.reset-zoom-button {- padding: 0.2em;- background: transparent;- color: var(--text-primary-color);font-family: var(--ui-font);}@@ -491,7 +445,6 @@.eraser-buttons {display: grid;grid-auto-flow: column;- gap: 0.4em;margin-top: auto;margin-bottom: auto;margin-inline-start: 0.6em;@@ -572,17 +525,49 @@// use custom, minimalistic scrollbar// (doesn't work in Firefox)::-webkit-scrollbar {- width: 5px;+ width: 3px;}+::-webkit-scrollbar-thumb {- background: var(--button-gray-2);+ background: var(--scrollbar-thumb);border-radius: 10px;}::-webkit-scrollbar-thumb:hover {- background: var(--button-gray-3);+ background: var(--scrollbar-thumb-hover);}::-webkit-scrollbar-thumb:active {- background: var(--button-gray-2);+ background: var(--scrollbar-thumb);+ }++ .mobile-misc-tools-container {+ position: fixed;+ top: 5rem;+ right: 0;+ display: flex;+ flex-direction: column;+ border: 1px solid var(--sidebar-border-color);+ border-top-left-radius: var(--border-radius-lg);+ border-bottom-left-radius: var(--border-radius-lg);+ border-right: 0;++ background-color: var(--island-bg-color);++ .ToolIcon__icon {+ border-radius: 0;+ }++ .library-button {+ border: 0;+ }+ }++ .App-toolbar--mobile {+ overflow-x: hidden;+ max-width: 100vw;++ .ToolIcon__keybinding {+ display: none;+ }}}diff --git a/src/css/theme.scss b/src/css/theme.scssindex 1827a74bc2..aaa8da5b50 100644--- a/src/css/theme.scss+++ b/src/css/theme.scss@@ -9,10 +9,10 @@--button-gray-2: #{$oc-gray-4};--button-gray-3: #{$oc-gray-5};--button-special-active-bg-color: #{$oc-green-0};- --dialog-border-color: #{$oc-gray-6};+ --dialog-border-color: var(--color-gray-20);--dropdown-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>');--focus-highlight-color: #{$oc-blue-2};- --icon-fill-color: #{$oc-gray-9};+ --icon-fill-color: var(--color-gray-80);--icon-green-fill-color: #{$oc-green-9};--default-bg-color: #{$oc-white};--input-bg-color: #{$oc-white};@@ -20,7 +20,7 @@--input-hover-bg-color: #{$oc-gray-1};--input-label-color: #{$oc-gray-7};--island-bg-color: rgba(255, 255, 255, 0.96);- --keybinding-color: #{$oc-gray-5};+ --keybinding-color: var(--color-gray-40);--link-color: #{$oc-blue-7};--overlay-bg-color: #{transparentize($oc-white, 0.12)};--popup-bg-color: #{$oc-white};@@ -32,22 +32,75 @@--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #{$oc-blue-5};- --shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);+ --shadow-island: 0px 7px 14px rgba(0, 0, 0, 0.05),+ 0px 0px 3.12708px rgba(0, 0, 0, 0.0798),+ 0px 0px 0.931014px rgba(0, 0, 0, 0.1702);+ --button-hover: var(--color-gray-10);+ --default-border-color: var(--color-gray-30);++ --default-button-size: 2rem;+ --default-icon-size: 1rem;+ --lg-button-size: 2.25rem;+ --lg-icon-size: 1rem;++ @media screen and (min-device-width: 1921px) {+ --lg-button-size: 2.5rem;+ --lg-icon-size: 1.25rem;+ --default-button-size: 2.25rem;+ --default-icon-size: 1.25rem;+ }++ --scrollbar-thumb: var(--button-gray-2);+ --scrollbar-thumb-hover: var(--button-gray-3);++ --modal-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07),+ 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198),+ 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275),+ 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035),+ 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725),+ 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);+ --avatar-border-color: var(--color-gray-20);+ --sidebar-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07),+ 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198),+ 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275),+ 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035),+ 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725),+ 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);+ --sidebar-border-color: var(--color-gray-20);+ --sidebar-bg-color: #fff;+ --library-dropdown-shadow: 0px 15px 6px rgba(0, 0, 0, 0.01),+ 0px 8px 5px rgba(0, 0, 0, 0.05), 0px 4px 4px rgba(0, 0, 0, 0.09),+ 0px 1px 2px rgba(0, 0, 0, 0.1), 0px 0px 0px rgba(0, 0, 0, 0.1);--space-factor: 0.25rem;- --text-primary-color: #{$oc-gray-8};+ --text-primary-color: var(--color-gray-80);++ --color-selection: #6965db;--color-primary: #6965db;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;- --color-primary-light: #e2e1fc;+ --color-primary-light: #e3e2fe;++ --color-gray-10: #f5f5f5;+ --color-gray-20: #ebebeb;+ --color-gray-30: #d6d6d6;+ --color-gray-40: #b8b8b8;+ --color-gray-50: #999999;+ --color-gray-60: #7a7a7a;+ --color-gray-70: #5c5c5c;+ --color-gray-80: #3d3d3d;+ --color-gray-85: #242424;+ --color-gray-90: #1e1e1e;+ --color-gray-100: #121212;++ --color-danger: #db6965;+ --color-promo: #e70078;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem;&.theme--dark {- background: $oc-black;-&.theme--dark-background-none {background: none;}@@ -57,22 +110,23 @@--theme-filter: #{$theme-filter};--button-destructive-bg-color: #5a0000;--button-destructive-color: #{$oc-red-3};+--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;- --dialog-border-color: #{$oc-gray-9};+ --dialog-border-color: var(--color-gray-80);--dropdown-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>');--focus-highlight-color: #{$oc-blue-6};- --icon-fill-color: #{$oc-gray-4};+ --icon-fill-color: var(--color-gray-40);--icon-green-fill-color: #{$oc-green-4};--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #{$oc-gray-2};- --island-bg-color: rgba(30, 30, 30, 0.98);- --keybinding-color: #{$oc-gray-6};+ --island-bg-color: #262627;+ --keybinding-color: var(--color-gray-60);--link-color: #{$oc-blue-4};--overlay-bg-color: #{transparentize($oc-gray-8, 0.88)};--popup-bg-color: #2c2c2c;@@ -80,12 +134,35 @@--popup-text-color: #{$oc-gray-4};--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #{$oc-blue-4};- --shadow-island: 1px 1px 5px #{transparentize($oc-black, 0.7)};- --text-primary-color: #{$oc-gray-4};+ --text-primary-color: var(--color-gray-40);+ --button-hover: var(--color-gray-80);+ --default-border-color: var(--color-gray-80);+ --shadow-island: 0px 13px 33px rgba(0, 0, 0, 0.07),+ 0px 4.13px 9.94853px rgba(0, 0, 0, 0.0456112),+ 0px 1.13px 4.13211px rgba(0, 0, 0, 0.035),+ 0px 0.769896px 1.4945px rgba(0, 0, 0, 0.0243888);+ --modal-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07),+ 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198),+ 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275),+ 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035),+ 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725),+ 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);+ --avatar-border-color: var(--color-gray-85);+ --sidebar-border-color: var(--color-gray-85);+ --sidebar-bg-color: #191919;++ --scrollbar-thumb: #{$oc-gray-8};+ --scrollbar-thumb-hover: #{$oc-gray-7};++ // will be inverted to a lighter color.+ --color-selection: #3530c4;++ --color-primary: #a8a5ff;+ --color-primary-darker: #b2aeff;+ --color-primary-darkest: #beb9ff;+ --color-primary-light: #4f4d6f;- --color-primary: #5650f0;- --color-primary-darker: #4b46d8;- --color-primary-darkest: #3e39be;- --color-primary-light: #3f3d64;+ --color-danger: #ffa8a5;+ --color-promo: #d297ff;}}diff --git a/src/css/variables.module.scss b/src/css/variables.module.scssindex 4c90fd1360..5a367ffe3e 100644--- a/src/css/variables.module.scss+++ b/src/css/variables.module.scss@@ -7,18 +7,28 @@}@mixin toolbarButtonColorStates {+ &.fillable {+ .ToolIcon_type_radio,+ .ToolIcon_type_checkbox {+ &:checked + .ToolIcon__icon {+ --icon-fill-color: var(--color-primary-darker);++ svg {+ fill: var(--icon-fill-color);+ }+ }+ }+ }+.ToolIcon_type_radio,.ToolIcon_type_checkbox {- & + .ToolIcon__icon:active {- background: var(--color-primary-light);- }&:checked + .ToolIcon__icon {- background: var(--color-primary);- --icon-fill-color: #{$oc-white};- --keybinding-color: #{$oc-white};- }- &:checked + .ToolIcon__icon:active {- background: var(--color-primary-darker);+ background: var(--color-primary-light);+ --keybinding-color: var(--color-gray-60);++ svg {+ color: var(--color-primary-darker);+ }}}@@ -26,6 +36,56 @@bottom: 4px;right: 4px;}++ .ToolIcon__icon {+ &:hover {+ background: var(--button-hover);+ }++ &:active {+ background: var(--button-hover);+ border: 1px solid var(--color-primary-darkest);+ }+ }+}++@mixin outlineButtonStyles {+ display: flex;+ justify-content: center;+ align-items: center;+ padding: 0.625rem;+ width: var(--default-button-size);+ height: var(--default-button-size);+ box-sizing: border-box;+ border-width: 1px;+ border-style: solid;+ border-color: var(--default-border-color);+ border-radius: var(--border-radius-lg);+ cursor: pointer;+ background-color: transparent;+ color: var(--text-primary-color);++ &:hover {+ background-color: var(--button-hover);+ }++ &:active {+ background-color: var(--button-hover);+ border-color: var(--color-primary-darkest);+ }++ &.active {+ background-color: var(--color-primary-light);+ border-color: var(--color-primary-light);++ &:hover {+ background-color: var(--color-primary-light);+ }++ svg {+ color: var(--color-primary-darker);+ }+ }}$theme-filter: "invert(93%) hue-rotate(180deg)";diff --git a/src/element/Hyperlink.tsx b/src/element/Hyperlink.tsxindex 37ed2b0964..a25403839c 100644--- a/src/element/Hyperlink.tsx+++ b/src/element/Hyperlink.tsx@@ -10,7 +10,7 @@ import { NonDeletedExcalidrawElement } from "./types";import { register } from "../actions/register";import { ToolButton } from "../components/ToolButton";-import { editIcon, link, trash } from "../components/icons";+import { FreedrawIcon, LinkIcon, TrashIcon } from "../components/icons";import { t } from "../i18n";import {useCallback,@@ -197,7 +197,7 @@ export const Hyperlink = ({label={t("buttons.edit")}onClick={onEdit}className="excalidraw-hyperlinkContainer--edit"- icon={editIcon}+ icon={FreedrawIcon}/>)}@@ -209,7 +209,7 @@ export const Hyperlink = ({label={t("buttons.remove")}onClick={handleRemove}className="excalidraw-hyperlinkContainer--remove"- icon={trash}+ icon={TrashIcon}/>)}</div>@@ -277,7 +277,7 @@ export const actionLink = register({return (<ToolButtontype="button"- icon={link}+ icon={LinkIcon}aria-label={t(getContextMenuLabel(elements, appState))}title={`${t("labels.link.label")} - ${getShortcutKey("CtrlOrCmd+K")}`}onClick={() => updateData(null)}diff --git a/src/element/transformHandles.ts b/src/element/transformHandles.tsindex 5821b0b493..210a2eab68 100644--- a/src/element/transformHandles.ts+++ b/src/element/transformHandles.ts@@ -100,7 +100,7 @@ export const getTransformHandlesFromCoords = (const cx = (x1 + x2) / 2;const cy = (y1 + y2) / 2;const dashedLineMargin = margin / zoom.value;- const centeringOffset = (size - 8) / (2 * zoom.value);+ const centeringOffset = (size - DEFAULT_SPACING * 2) / (2 * zoom.value);const transformHandles: TransformHandles = {nw: omitSides.nw@@ -253,7 +253,7 @@ export const getTransformHandles = (omitSides = OMIT_SIDES_FOR_TEXT_ELEMENT;}const dashedLineMargin = isLinearElement(element)- ? DEFAULT_SPACING * 3+ ? DEFAULT_SPACING + 8: DEFAULT_SPACING;return getTransformHandlesFromCoords(getElementAbsoluteCoords(element),diff --git a/src/excalidraw-app/collab/RoomDialog.scss b/src/excalidraw-app/collab/RoomDialog.scssindex 96dd6e162b..c8bf0dcdec 100644--- a/src/excalidraw-app/collab/RoomDialog.scss+++ b/src/excalidraw-app/collab/RoomDialog.scss@@ -1,6 +1,10 @@@import "../../css/variables.module";.excalidraw {+ .RoomDialog__button {+ border: 1px solid var(--default-border-color) !important;+ }+.RoomDialog-linkContainer {display: flex;margin: 1.5em 0;diff --git a/src/excalidraw-app/collab/RoomDialog.tsx b/src/excalidraw-app/collab/RoomDialog.tsxindex 724856b3d4..d4adf97710 100644--- a/src/excalidraw-app/collab/RoomDialog.tsx+++ b/src/excalidraw-app/collab/RoomDialog.tsx@@ -16,6 +16,7 @@ import Stack from "../../components/Stack";import { AppState } from "../../types";import { trackEvent } from "../../analytics";import { getFrame } from "../../utils";+import DialogActionButton from "../../components/DialogActionButton";const getShareIcon = () => {const navigator = window.navigator as any;@@ -90,18 +91,15 @@ const RoomDialog = ({<p>{t("roomDialog.desc_intro")}</p><p>{`🔒 ${t("roomDialog.desc_privacy")}`}</p><div className="RoomDialog-sessionStartButtonContainer">- <ToolButton- className="RoomDialog-startSession"- type="button"- icon={start}- title={t("roomDialog.button_startSession")}- aria-label={t("roomDialog.button_startSession")}- showAriaLabel={true}+ <DialogActionButton+ label={t("roomDialog.button_startSession")}onClick={() => {trackEvent("share", "room creation", `ui (${getFrame()})`);onRoomCreate();}}- />+ >+ {start}+ </DialogActionButton></div></>)}@@ -113,6 +111,7 @@ const RoomDialog = ({<Stack.Row gap={2}>{"share" in navigator ? (<ToolButton+ className="RoomDialog__button"type="button"icon={getShareIcon()}title={t("labels.share")}@@ -121,6 +120,7 @@ const RoomDialog = ({/>) : null}<ToolButton+ className="RoomDialog__button"type="button"icon={clipboard}title={t("labels.copy")}@@ -158,18 +158,16 @@ const RoomDialog = ({</p><p>{t("roomDialog.desc_exitSession")}</p><div className="RoomDialog-sessionStartButtonContainer">- <ToolButton- className="RoomDialog-stopSession"- type="button"- icon={stop}- title={t("roomDialog.button_stopSession")}- aria-label={t("roomDialog.button_stopSession")}- showAriaLabel={true}+ <DialogActionButton+ actionType="danger"+ label={t("roomDialog.button_stopSession")}onClick={() => {trackEvent("share", "room closed");onRoomDestroy();}}- />+ >+ {stop}+ </DialogActionButton></div></>)}diff --git a/src/excalidraw-app/components/LanguageList.tsx b/src/excalidraw-app/components/LanguageList.tsxindex 84498ea36e..375bde62b1 100644--- a/src/excalidraw-app/components/LanguageList.tsx+++ b/src/excalidraw-app/components/LanguageList.tsx@@ -1,30 +1,30 @@+import { useAtom } from "jotai";import React from "react";+import { langCodeAtom } from "..";import * as i18n from "../../i18n";+import { languages } from "../../i18n";-export const LanguageList = ({- onChange,- languages = i18n.languages,- currentLangCode = i18n.getLanguage().code,-}: {- languages?: { code: string; label: string }[];- onChange: (langCode: i18n.Language["code"]) => void;- currentLangCode?: i18n.Language["code"];-}) => (- <React.Fragment>- <select- className="dropdown-select dropdown-select__language"- onChange={({ target }) => onChange(target.value)}- value={currentLangCode}- aria-label={i18n.t("buttons.selectLanguage")}- >- <option key={i18n.defaultLang.code} value={i18n.defaultLang.code}>- {i18n.defaultLang.label}- </option>- {languages.map((lang) => (- <option key={lang.code} value={lang.code}>- {lang.label}+export const LanguageList = ({ style }: { style?: React.CSSProperties }) => {+ const [langCode, setLangCode] = useAtom(langCodeAtom);++ return (+ <React.Fragment>+ <select+ className="dropdown-select dropdown-select__language"+ onChange={({ target }) => setLangCode(target.value)}+ value={langCode}+ aria-label={i18n.t("buttons.selectLanguage")}+ style={style}+ >+ <option key={i18n.defaultLang.code} value={i18n.defaultLang.code}>+ {i18n.defaultLang.label}</option>- ))}- </select>- </React.Fragment>-);+ {languages.map((lang) => (+ <option key={lang.code} value={lang.code}>+ {lang.label}+ </option>+ ))}+ </select>+ </React.Fragment>+ );+};diff --git a/src/excalidraw-app/index.scss b/src/excalidraw-app/index.scssindex 3bd16dbcd7..1ea39c1b03 100644--- a/src/excalidraw-app/index.scss+++ b/src/excalidraw-app/index.scss@@ -28,8 +28,7 @@}.excalidraw-app.is-collaborating {[data-testid="clear-canvas-button"] {- visibility: hidden;- pointer-events: none;+ display: none;}}@@ -39,12 +38,15 @@cursor: pointer;align-items: center;border: 1px solid var(--color-primary);- padding: 0.6em 0.7em;+ padding: 0.5rem 0.75rem;border-radius: var(--space-factor);color: var(--color-primary) !important;- margin: 8px;text-decoration: none !important;+ font-size: 0.75rem;+ box-sizing: border-box;+ height: var(--default-button-size);+&:hover {background-color: var(--color-primary);color: white !important;@@ -54,3 +56,11 @@background-color: var(--color-primary-darker);}}++.theme--dark {+ .plus-button {+ &:hover {+ color: black !important;+ }+ }+}diff --git a/src/excalidraw-app/index.tsx b/src/excalidraw-app/index.tsxindex fbc784214c..3f78e26b82 100644--- a/src/excalidraw-app/index.tsx+++ b/src/excalidraw-app/index.tsx@@ -1,6 +1,6 @@import polyfill from "../polyfill";import LanguageDetector from "i18next-browser-languagedetector";-import { useCallback, useEffect, useRef, useState } from "react";+import { useEffect, useRef, useState } from "react";import { trackEvent } from "../analytics";import { getDefaultAppState } from "../appState";import { ErrorDialog } from "../components/ErrorDialog";@@ -22,11 +22,7 @@ import {} from "../element/types";import { useCallbackRefState } from "../hooks/useCallbackRefState";import { t } from "../i18n";-import {- Excalidraw,- defaultLang,- languages,-} from "../packages/excalidraw/index";+import { Excalidraw, defaultLang } from "../packages/excalidraw/index";import {AppState,LibraryItems,@@ -68,8 +64,6 @@ import {} from "./data/localStorage";import CustomStats from "./CustomStats";import { restore, restoreAppState, RestoredDataState } from "../data/restore";-import { Tooltip } from "../components/Tooltip";-import { shield } from "../components/icons";import "./index.scss";import { ExportToExcalidrawPlus } from "./components/ExportToExcalidrawPlus";@@ -81,10 +75,11 @@ import { loadFilesFromFirebase } from "./data/firebase";import { LocalData } from "./data/LocalData";import { isBrowserStorageStateNewer } from "./data/tabSync";import clsx from "clsx";-import { Provider, useAtom } from "jotai";+import { atom, Provider, useAtom } from "jotai";import { jotaiStore, useAtomWithInitialValue } from "../jotai";import { reconcileElements } from "./collab/reconciliation";import { parseLibraryTokensFromUrl, useHandleLibrary } from "../data/library";+import EncryptedIcon from "../components/EncryptedIcon";polyfill();window.EXCALIDRAW_THROTTLE_RENDER = true;@@ -230,38 +225,16 @@ const initializeScene = async (opts: {return { scene: null, isExternalScene: false };};-const PlusLPLinkJSX = (- <p style={{ direction: "ltr", unicodeBidi: "embed" }}>- Introducing Excalidraw+- <br />- <a- href="https://plus.excalidraw.com/plus?utm_source=excalidraw&utm_medium=banner&utm_campaign=launch"- target="_blank"- rel="noreferrer"- >- Try out now!- </a>- </p>-);+const currentLangCode = languageDetector.detect() || defaultLang.code;-const PlusAppLinkJSX = (- <a- href={`${process.env.REACT_APP_PLUS_APP}/#excalidraw-redirect`}- target="_blank"- rel="noreferrer"- className="plus-button"- >- Go to Excalidraw+- </a>+export const langCodeAtom = atom(+ Array.isArray(currentLangCode) ? currentLangCode[0] : currentLangCode,);const ExcalidrawWrapper = () => {const [errorMessage, setErrorMessage] = useState("");- let currentLangCode = languageDetector.detect() || defaultLang.code;- if (Array.isArray(currentLangCode)) {- currentLangCode = currentLangCode[0];- }- const [langCode, setLangCode] = useState(currentLangCode);+ const [langCode, setLangCode] = useAtom(langCodeAtom);+// initial state// ---------------------------------------------------------------------------@@ -489,7 +462,7 @@ const ExcalidrawWrapper = () => {);clearTimeout(titleTimeout);};- }, [collabAPI, excalidrawAPI]);+ }, [collabAPI, excalidrawAPI, setLangCode]);useEffect(() => {const unloadHandler = (event: BeforeUnloadEvent) => {@@ -603,93 +576,40 @@ const ExcalidrawWrapper = () => {}};- const renderTopRightUI = useCallback(- (isMobile: boolean, appState: AppState) => {- if (isMobile) {- return null;- }-+ const renderFooter = (isMobile: boolean) => {+ const renderLanguageList = () => <LanguageList />;+ if (isMobile) {return (<divstyle={{- width: isExcalidrawPlusSignedUser ? "21ch" : "23ch",- fontSize: "0.7em",- textAlign: "center",+ display: "flex",+ flexDirection: "column",}}>- {isExcalidrawPlusSignedUser ? PlusAppLinkJSX : PlusLPLinkJSX}+ <div style={{ marginBottom: ".5rem", fontSize: "0.75rem" }}>+ {t("labels.language")}+ </div>+ <div style={{ padding: "0 0.625rem" }}>{renderLanguageList()}</div></div>);- },- [],- );-- const renderFooter = useCallback(- (isMobile: boolean) => {- const renderEncryptedIcon = () => (- <a- className="encrypted-icon tooltip"- href="https://blog.excalidraw.com/end-to-end-encryption/"- target="_blank"- rel="noopener noreferrer"- aria-label={t("encrypted.link")}- >- <Tooltip label={t("encrypted.tooltip")} long={true}>- {shield}- </Tooltip>- </a>- );+ }- const renderLanguageList = () => (- <LanguageList- onChange={(langCode) => setLangCode(langCode)}- languages={languages}- currentLangCode={langCode}- />- );- if (isMobile) {- const isTinyDevice = window.innerWidth < 362;- return (- <div- style={{- display: "flex",- flexDirection: isTinyDevice ? "column" : "row",- }}+ return (+ <div style={{ display: "flex", gap: ".5rem", alignItems: "center" }}>+ {isExcalidrawPlusSignedUser && (+ <a+ href={`${process.env.REACT_APP_PLUS_APP}?utm_source=excalidraw&utm_medium=app&utm_content=signedInUserRedirectButton#excalidraw-redirect`}+ target="_blank"+ rel="noreferrer"+ className="plus-button">- <fieldset>- <legend>{t("labels.language")}</legend>- {renderLanguageList()}- </fieldset>- {/* FIXME remove after 2021-05-20 */}- <div- style={{- width: "24ch",- fontSize: "0.7em",- textAlign: "center",- marginTop: isTinyDevice ? 16 : undefined,- marginLeft: "auto",- marginRight: isTinyDevice ? "auto" : undefined,- padding: isExcalidrawPlusSignedUser ? undefined : "4px 2px",- border: isExcalidrawPlusSignedUser- ? undefined- : "1px dashed #aaa",- borderRadius: 12,- }}- >- {isExcalidrawPlusSignedUser ? PlusAppLinkJSX : PlusLPLinkJSX}- </div>- </div>- );- }- return (- <>- {renderEncryptedIcon()}- {renderLanguageList()}- </>- );- },- [langCode],- );+ Go to Excalidraw++ </a>+ )}+ <EncryptedIcon />+ </div>+ );+ };const renderCustomStats = (elements: readonly NonDeletedExcalidrawElement[],@@ -751,7 +671,6 @@ const ExcalidrawWrapper = () => {},},}}- renderTopRightUI={renderTopRightUI}renderFooter={renderFooter}langCode={langCode}renderCustomStats={renderCustomStats}diff --git a/src/global.d.ts b/src/global.d.tsindex 266957cf9b..0146409487 100644--- a/src/global.d.ts+++ b/src/global.d.ts@@ -18,6 +18,22 @@ interface Window {gtag: Function;}+interface CanvasRenderingContext2D {+ // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect+ roundRect?: (+ x: number,+ y: number,+ width: number,+ height: number,+ radii:+ | number // [all-corners]+ | [number] // [all-corners]+ | [number, number] // [top-left-and-bottom-right, top-right-and-bottom-left]+ | [number, number, number] // [top-left, top-right-and-bottom-left, bottom-right]+ | [number, number, number, number], // [top-left, top-right, bottom-right, bottom-left]+ ) => void;+}+// https://github.com/facebook/create-react-app/blob/ddcb7d5/packages/react-scripts/lib/react-app.d.tsdeclare namespace NodeJS {interface ProcessEnv {diff --git a/src/hooks/useOutsideClick.ts b/src/hooks/useOutsideClick.tsnew file mode 100644index 0000000000..bdd16c8d19--- /dev/null+++ b/src/hooks/useOutsideClick.ts@@ -0,0 +1,41 @@+import { useEffect, useRef } from "react";++export const useOutsideClickHook = (handler: (event: Event) => void) => {+ const ref = useRef(null);++ useEffect(+ () => {+ const listener = (event: Event) => {+ const current = ref.current as HTMLElement | null;++ // Do nothing if clicking ref's element or descendent elements+ if (+ !current ||+ current.contains(event.target as Node) ||+ [...document.querySelectorAll("[data-prevent-outside-click]")].some(+ (el) => el.contains(event.target as Node),+ )+ ) {+ return;+ }++ handler(event);+ };+ document.addEventListener("mousedown", listener);+ document.addEventListener("touchstart", listener);+ return () => {+ document.removeEventListener("mousedown", listener);+ document.removeEventListener("touchstart", listener);+ };+ },+ // Add ref and handler to effect dependencies+ // It's worth noting that because passed in handler is a new ...+ // ... function on every render that will cause this effect ...+ // ... callback/cleanup to run every render. It's not a big deal ...+ // ... but to optimize you can wrap handler in useCallback before ...+ // ... passing it into this hook.+ [ref, handler],+ );++ return ref;+};diff --git a/src/locales/en.json b/src/locales/en.jsonindex c11d0bc7d7..f767640bc0 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -71,7 +71,7 @@"layers": "Layers","actions": "Actions","language": "Language",- "liveCollaboration": "Live collaboration",+ "liveCollaboration": "Live collaboration...","duplicateSelection": "Duplicate","untitled": "Untitled","name": "Name",@@ -136,8 +136,8 @@"buttons": {"clearReset": "Reset the canvas","exportJSON": "Export to file",- "exportImage": "Save as image",- "export": "Export",+ "exportImage": "Export image...",+ "export": "Save to...","exportToPng": "Export to PNG","exportToSvg": "Export to SVG","copyToClipboard": "Copy to clipboard",@@ -145,7 +145,7 @@"scale": "Scale","save": "Save to current file","saveAs": "Save as",- "load": "Load",+ "load": "Open","getShareableLink": "Get shareable link","close": "Close","selectLanguage": "Select language",@@ -215,7 +215,7 @@"text": "Text","library": "Library","lock": "Keep selected tool active after drawing",- "penMode": "Prevent pinch-zoom and accept freedraw input only from pen",+ "penMode": "Pen mode - prevent touch","link": "Add/ Update link for a selected shape","eraser": "Eraser"},@@ -440,5 +440,12 @@"5c940d": "Lime 9","e67700": "Yellow 9","d9480f": "Orange 9"+ },+ "welcomeScreen": {+ "data": "All your data is saved locally in your browser.",+ "switchToPlusApp": "Did you want to go to the Excalidraw+ instead?",+ "menuHints": "Export, preferences, languages, ...",+ "toolbarHints": "Pick a tool & Start drawing!",+ "helpHints": "Shortcuts & help"}}diff --git a/src/locales/hu-HU.json b/src/locales/hu-HU.jsonindex 23afab0f59..35eb7e0964 100644--- a/src/locales/hu-HU.json+++ b/src/locales/hu-HU.json@@ -439,5 +439,11 @@"5c940d": "Lime 9","e67700": "Sárga 9","d9480f": "Narancs 9"+ },+ "welcomeScreen": {+ "data": "Minden adatodat kizárólag a böngésződben tároljuk.",+ "menuHints": "Export, beállítások, nyelvek, ...",+ "toolbarHints": "Válassz egy eszközt & kezdj alkotni!",+ "helpHints": "Gyorsbillentyűk & súgó"}}diff --git a/src/renderer/renderElement.ts b/src/renderer/renderElement.tsindex 1265aebc8b..a951f66da5 100644--- a/src/renderer/renderElement.ts+++ b/src/renderer/renderElement.ts@@ -743,8 +743,19 @@ export const renderElement = (element.x + renderConfig.scrollX,element.y + renderConfig.scrollY,);- context.fillStyle = "rgba(0, 0, 255, 0.10)";- context.fillRect(0, 0, element.width, element.height);+ context.fillStyle = "rgba(0, 0, 200, 0.04)";++ // render from 0.5px offset to get 1px wide line+ // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540+ // TODO can be be improved by offseting to the negative when user selects+ // from right to left+ const offset = 0.5 / renderConfig.zoom.value;++ context.fillRect(offset, offset, element.width, element.height);+ context.lineWidth = 1 / renderConfig.zoom.value;+ context.strokeStyle = "rgb(105, 101, 219)";+ context.strokeRect(offset, offset, element.width, element.height);+context.restore();break;}diff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.tsindex d4c6e19de5..8aebcdcb99 100644--- a/src/renderer/renderScene.ts+++ b/src/renderer/renderScene.ts@@ -62,7 +62,7 @@ import {import { isLinearElement } from "../element/typeChecks";const hasEmojiSupport = supportsEmoji();-export const DEFAULT_SPACING = 4;+export const DEFAULT_SPACING = 2;const strokeRectWithRotation = (context: CanvasRenderingContext2D,@@ -341,6 +341,8 @@ export const _renderScene = ({isExporting,} = renderConfig;+ const selectionColor = renderConfig.selectionColor || oc.black;+const context = canvas.getContext("2d")!;context.setTransform(1, 0, 0, 1, 0, 0);@@ -492,7 +494,7 @@ export const _renderScene = ({locallySelectedIds.includes(element.id) &&!isSelectedViaGroup(appState, element)) {- selectionColors.push(oc.black);+ selectionColors.push(selectionColor);}// remote usersif (renderConfig.remoteSelectedElementIds[element.id]) {@@ -505,6 +507,7 @@ export const _renderScene = ({),);}+if (selectionColors.length) {const [elementX1, elementY1, elementX2, elementY2] =getElementAbsoluteCoords(element);@@ -515,10 +518,11 @@ export const _renderScene = ({elementX2,elementY2,selectionColors,+ dashed: !!renderConfig.remoteSelectedElementIds[element.id],});}return acc;- }, [] as { angle: number; elementX1: number; elementY1: number; elementX2: number; elementY2: number; selectionColors: string[] }[]);+ }, [] as { angle: number; elementX1: number; elementY1: number; elementX2: number; elementY2: number; selectionColors: string[]; dashed?: boolean }[]);const addSelectionForGroupId = (groupId: GroupId) => {const groupElements = getElementsInGroup(elements, groupId);@@ -530,7 +534,8 @@ export const _renderScene = ({elementX2,elementY1,elementY2,- selectionColors: [oc.black],+ selectionColors: [selectionColor],+ dashed: true,});};@@ -542,15 +547,9 @@ export const _renderScene = ({if (appState.editingGroupId) {addSelectionForGroupId(appState.editingGroupId);}+selections.forEach((selection) =>- renderSelectionBorder(- context,- renderConfig,- selection,- isSingleLinearElementSelected- ? DEFAULT_SPACING * 2- : DEFAULT_SPACING,- ),+ renderSelectionBorder(context, renderConfig, selection),);}// Paint resize transformHandles@@ -573,13 +572,15 @@ export const _renderScene = ({);}} else if (locallySelectedElements.length > 1 && !appState.isRotating) {- const dashedLinePadding = 4 / renderConfig.zoom.value;+ const dashedLinePadding =+ (DEFAULT_SPACING * 2) / renderConfig.zoom.value;context.fillStyle = oc.white;const [x1, y1, x2, y2] = getCommonBounds(locallySelectedElements);const initialLineDash = context.getLineDash();context.setLineDash([2 / renderConfig.zoom.value]);const lineWidth = context.lineWidth;context.lineWidth = 1 / renderConfig.zoom.value;+ context.strokeStyle = selectionColor;strokeRectWithRotation(context,x1 - dashedLinePadding,@@ -676,13 +677,11 @@ export const _renderScene = ({idleState = hasEmojiSupport ? "⚫️" : ` (${UserIdleState.AWAY})`;} else if (userState === UserIdleState.IDLE) {idleState = hasEmojiSupport ? "💤" : ` (${UserIdleState.IDLE})`;- } else if (userState === UserIdleState.ACTIVE) {- idleState = hasEmojiSupport ? "🟢" : "";}- const usernameAndIdleState = `${- username ? `${username} ` : ""- }${idleState}`;+ const usernameAndIdleState = `${username || ""}${+ idleState ? ` ${idleState}` : ""+ }`;if (!isOutOfBounds && usernameAndIdleState) {const offsetX = x + width;@@ -693,22 +692,31 @@ export const _renderScene = ({const measureHeight =measure.actualBoundingBoxDescent + measure.actualBoundingBoxAscent;- // Border- context.fillStyle = stroke;- context.fillRect(- offsetX - 1,- offsetY - 1,- measure.width + 2 * paddingHorizontal + 2,- measureHeight + 2 * paddingVertical + 2,- );- // Background- context.fillStyle = background;- context.fillRect(- offsetX,- offsetY,- measure.width + 2 * paddingHorizontal,- measureHeight + 2 * paddingVertical,- );+ const boxX = offsetX - 1;+ const boxY = offsetY - 1;+ const boxWidth = measure.width + 2 * paddingHorizontal + 2;+ const boxHeight = measureHeight + 2 * paddingVertical + 2;+ if (context.roundRect) {+ context.beginPath();+ context.roundRect(+ boxX,+ boxY,+ boxWidth,+ boxHeight,+ 4 / renderConfig.zoom.value,+ );+ context.fillStyle = background;+ context.fill();+ context.fillStyle = stroke;+ context.stroke();+ } else {+ // Border+ context.fillStyle = stroke;+ context.fillRect(boxX, boxY, boxWidth, boxHeight);+ // Background+ context.fillStyle = background;+ context.fillRect(offsetX, offsetY, boxWidth - 2, boxHeight - 2);+ }context.fillStyle = oc.white;context.fillText(@@ -807,8 +815,17 @@ const renderTransformHandles = (context.save();context.lineWidth = 1 / renderConfig.zoom.value;+ if (renderConfig.selectionColor) {+ context.strokeStyle = renderConfig.selectionColor;+ }if (key === "rotation") {fillCircle(context, x + width / 2, y + height / 2, width / 2);+ // prefer round corners if roundRect API is available+ } else if (context.roundRect) {+ context.beginPath();+ context.roundRect(x, y, width, height, 2 / renderConfig.zoom.value);+ context.fill();+ context.stroke();} else {strokeRectWithRotation(context,@@ -837,16 +854,24 @@ const renderSelectionBorder = (elementX2: number;elementY2: number;selectionColors: string[];+ dashed?: boolean;},- padding = 4,+ padding = DEFAULT_SPACING * 2,) => {- const { angle, elementX1, elementY1, elementX2, elementY2, selectionColors } =- elementProperties;+ const {+ angle,+ elementX1,+ elementY1,+ elementX2,+ elementY2,+ selectionColors,+ dashed,+ } = elementProperties;const elementWidth = elementX2 - elementX1;const elementHeight = elementY2 - elementY1;- const dashedLinePadding = padding / renderConfig.zoom.value;- const dashWidth = 8 / renderConfig.zoom.value;+ const linePadding = padding / renderConfig.zoom.value;+ const lineWidth = 8 / renderConfig.zoom.value;const spaceWidth = 4 / renderConfig.zoom.value;context.save();@@ -856,17 +881,19 @@ const renderSelectionBorder = (const count = selectionColors.length;for (let index = 0; index < count; ++index) {context.strokeStyle = selectionColors[index];- context.setLineDash([- dashWidth,- spaceWidth + (dashWidth + spaceWidth) * (count - 1),- ]);- context.lineDashOffset = (dashWidth + spaceWidth) * index;+ if (dashed) {+ context.setLineDash([+ lineWidth,+ spaceWidth + (lineWidth + spaceWidth) * (count - 1),+ ]);+ }+ context.lineDashOffset = (lineWidth + spaceWidth) * index;strokeRectWithRotation(context,- elementX1 - dashedLinePadding,- elementY1 - dashedLinePadding,- elementWidth + dashedLinePadding * 2,- elementHeight + dashedLinePadding * 2,+ elementX1 - linePadding,+ elementY1 - linePadding,+ elementWidth + linePadding * 2,+ elementHeight + linePadding * 2,elementX1 + elementWidth / 2,elementY1 + elementHeight / 2,angle,diff --git a/src/scene/types.ts b/src/scene/types.tsindex be05ddfde9..a54b02b265 100644--- a/src/scene/types.ts+++ b/src/scene/types.ts@@ -27,6 +27,7 @@ export type RenderConfig = {/** when exporting the behavior is slightly different (e.g. we can't useCSS filters), and we disable render optimizations for best output */isExporting: boolean;+ selectionColor?: string;};export type SceneScroll = {diff --git a/src/shapes.tsx b/src/shapes.tsxindex 19718331c8..0eb74b9b8c 100644--- a/src/shapes.tsx+++ b/src/shapes.tsx@@ -1,116 +1,84 @@+import {+ ArrowIcon,+ DiamondIcon,+ EllipseIcon,+ EraserIcon,+ FreedrawIcon,+ ImageIcon,+ LineIcon,+ RectangleIcon,+ SelectionIcon,+ TextIcon,+} from "./components/icons";import { KEYS } from "./keys";-// We inline font-awesome icons in order to save on js size rather than including the font awesome react libraryexport const SHAPES = [{- icon: (- // fa-mouse-pointer- <svg viewBox="0 0 320 512" className="">- <path d="M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z" />- </svg>- ),+ icon: SelectionIcon,value: "selection",key: KEYS.V,+ fillable: true,},{- icon: (- // fa-square- <svg viewBox="0 0 448 512">- <path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z" />- </svg>- ),+ icon: RectangleIcon,value: "rectangle",key: KEYS.R,+ fillable: true,},{- icon: (- // custom- <svg viewBox="0 0 223.646 223.646">- <path d="M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z" />- </svg>- ),+ icon: DiamondIcon,value: "diamond",key: KEYS.D,+ fillable: true,},{- icon: (- // fa-circle- <svg viewBox="0 0 512 512">- <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" />- </svg>- ),+ icon: EllipseIcon,value: "ellipse",key: KEYS.O,+ fillable: true,},{- icon: (- // fa-long-arrow-alt-right- <svg viewBox="0 0 448 512" className="rtl-mirror">- <path d="M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z" />- </svg>- ),+ icon: ArrowIcon,value: "arrow",key: KEYS.A,+ fillable: true,},{- icon: (- // custom- <svg viewBox="0 0 6 6">- <line- x1="0"- y1="3"- x2="6"- y2="3"- stroke="currentColor"- strokeLinecap="round"- />- </svg>- ),+ icon: LineIcon,value: "line",key: [KEYS.P, KEYS.L],+ fillable: true,},{- icon: (- // fa-pencil- <svg viewBox="0 0 512 512">- <path- fill="currentColor"- d="M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"- ></path>- </svg>- ),+ icon: FreedrawIcon,value: "freedraw",key: [KEYS.X, KEYS.P.toUpperCase()],+ fillable: false,},{- icon: (- // fa-font- <svg viewBox="0 0 448 512">- <path d="M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z" />- </svg>- ),+ icon: TextIcon,value: "text",key: KEYS.T,+ fillable: false,},{- icon: (- // fa-image- <svg viewBox="0 0 512 512">- <path- fill="currentColor"- d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"- ></path>- </svg>- ),+ icon: ImageIcon,value: "image",key: null,+ fillable: false,+ },+ {+ icon: EraserIcon,+ value: "eraser",+ key: KEYS.E,+ fillable: false,},] as const;export const findShapeByKey = (key: string) => {const shape = SHAPES.find((shape, index) => {return (- key === (index + 1).toString() ||+ key === (shape.value === "eraser" ? 0 : index + 1).toString() ||(shape.key &&(typeof shape.key === "string"? shape.key === keydiff --git a/src/tests/__snapshots__/contextmenu.test.tsx.snap b/src/tests/__snapshots__/contextmenu.test.tsx.snapindex 70bada660e..c16a47c305 100644--- a/src/tests/__snapshots__/contextmenu.test.tsx.snap+++ b/src/tests/__snapshots__/contextmenu.test.tsx.snap@@ -47,6 +47,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -72,9 +73,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -173,7 +174,7 @@ Object {exports[`contextMenu element right-clicking on a group should select whole group: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element right-clicking on a group should select whole group: [end of test] number of renders 1`] = `5`;+exports[`contextMenu element right-clicking on a group should select whole group: [end of test] number of renders 1`] = `6`;exports[`contextMenu element selecting 'Add to library' in context menu adds element to library: [end of test] appState 1`] = `Object {@@ -222,6 +223,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -244,9 +246,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -354,7 +356,7 @@ Object {exports[`contextMenu element selecting 'Add to library' in context menu adds element to library: [end of test] number of elements 1`] = `1`;-exports[`contextMenu element selecting 'Add to library' in context menu adds element to library: [end of test] number of renders 1`] = `10`;+exports[`contextMenu element selecting 'Add to library' in context menu adds element to library: [end of test] number of renders 1`] = `11`;exports[`contextMenu element selecting 'Bring forward' in context menu brings element forward: [end of test] appState 1`] = `Object {@@ -403,6 +405,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -425,9 +428,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -694,7 +697,7 @@ Object {exports[`contextMenu element selecting 'Bring forward' in context menu brings element forward: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Bring forward' in context menu brings element forward: [end of test] number of renders 1`] = `15`;+exports[`contextMenu element selecting 'Bring forward' in context menu brings element forward: [end of test] number of renders 1`] = `16`;exports[`contextMenu element selecting 'Bring to front' in context menu brings element to front: [end of test] appState 1`] = `Object {@@ -743,6 +746,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -765,9 +769,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1034,7 +1038,7 @@ Object {exports[`contextMenu element selecting 'Bring to front' in context menu brings element to front: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Bring to front' in context menu brings element to front: [end of test] number of renders 1`] = `15`;+exports[`contextMenu element selecting 'Bring to front' in context menu brings element to front: [end of test] number of renders 1`] = `16`;exports[`contextMenu element selecting 'Copy styles' in context menu copies styles: [end of test] appState 1`] = `Object {@@ -1083,6 +1087,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1105,9 +1110,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1215,7 +1220,7 @@ Object {exports[`contextMenu element selecting 'Copy styles' in context menu copies styles: [end of test] number of elements 1`] = `1`;-exports[`contextMenu element selecting 'Copy styles' in context menu copies styles: [end of test] number of renders 1`] = `10`;+exports[`contextMenu element selecting 'Copy styles' in context menu copies styles: [end of test] number of renders 1`] = `11`;exports[`contextMenu element selecting 'Delete' in context menu deletes element: [end of test] appState 1`] = `Object {@@ -1264,6 +1269,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1284,9 +1290,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1315,7 +1321,7 @@ Object {"locked": false,"opacity": 100,"roughness": 1,- "seed": 1278240551,+ "seed": 337897,"strokeColor": "#000000","strokeSharpness": "sharp","strokeStyle": "solid",@@ -1323,7 +1329,7 @@ Object {"type": "rectangle","updated": 1,"version": 3,- "versionNonce": 453191,+ "versionNonce": 449462985,"width": 20,"x": -10,"y": 0,@@ -1371,7 +1377,7 @@ Object {"locked": false,"opacity": 100,"roughness": 1,- "seed": 1278240551,+ "seed": 337897,"strokeColor": "#000000","strokeSharpness": "sharp","strokeStyle": "solid",@@ -1379,7 +1385,7 @@ Object {"type": "rectangle","updated": 1,"version": 2,- "versionNonce": 449462985,+ "versionNonce": 1278240551,"width": 20,"x": -10,"y": 0,@@ -1409,7 +1415,7 @@ Object {"locked": false,"opacity": 100,"roughness": 1,- "seed": 1278240551,+ "seed": 337897,"strokeColor": "#000000","strokeSharpness": "sharp","strokeStyle": "solid",@@ -1417,7 +1423,7 @@ Object {"type": "rectangle","updated": 1,"version": 3,- "versionNonce": 453191,+ "versionNonce": 449462985,"width": 20,"x": -10,"y": 0,@@ -1430,7 +1436,7 @@ Object {exports[`contextMenu element selecting 'Delete' in context menu deletes element: [end of test] number of elements 1`] = `1`;-exports[`contextMenu element selecting 'Delete' in context menu deletes element: [end of test] number of renders 1`] = `10`;+exports[`contextMenu element selecting 'Delete' in context menu deletes element: [end of test] number of renders 1`] = `11`;exports[`contextMenu element selecting 'Duplicate' in context menu duplicates element: [end of test] appState 1`] = `Object {@@ -1479,6 +1485,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1501,9 +1508,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1704,7 +1711,7 @@ Object {exports[`contextMenu element selecting 'Duplicate' in context menu duplicates element: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Duplicate' in context menu duplicates element: [end of test] number of renders 1`] = `10`;+exports[`contextMenu element selecting 'Duplicate' in context menu duplicates element: [end of test] number of renders 1`] = `11`;exports[`contextMenu element selecting 'Group selection' in context menu groups selected elements: [end of test] appState 1`] = `Object {@@ -1753,6 +1760,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1781,9 +1789,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -2062,7 +2070,7 @@ Object {exports[`contextMenu element selecting 'Group selection' in context menu groups selected elements: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Group selection' in context menu groups selected elements: [end of test] number of renders 1`] = `16`;+exports[`contextMenu element selecting 'Group selection' in context menu groups selected elements: [end of test] number of renders 1`] = `17`;exports[`contextMenu element selecting 'Paste styles' in context menu pastes styles: [end of test] appState 1`] = `Object {@@ -2111,6 +2119,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": "backgroundColorPicker","openSidebar": null,@@ -2133,9 +2142,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -2866,7 +2875,7 @@ Object {exports[`contextMenu element selecting 'Paste styles' in context menu pastes styles: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Paste styles' in context menu pastes styles: [end of test] number of renders 1`] = `27`;+exports[`contextMenu element selecting 'Paste styles' in context menu pastes styles: [end of test] number of renders 1`] = `28`;exports[`contextMenu element selecting 'Send backward' in context menu sends element backward: [end of test] appState 1`] = `Object {@@ -2915,6 +2924,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -2937,9 +2947,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3206,7 +3216,7 @@ Object {exports[`contextMenu element selecting 'Send backward' in context menu sends element backward: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Send backward' in context menu sends element backward: [end of test] number of renders 1`] = `14`;+exports[`contextMenu element selecting 'Send backward' in context menu sends element backward: [end of test] number of renders 1`] = `15`;exports[`contextMenu element selecting 'Send to back' in context menu sends element to back: [end of test] appState 1`] = `Object {@@ -3255,6 +3265,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -3277,9 +3288,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3546,7 +3557,7 @@ Object {exports[`contextMenu element selecting 'Send to back' in context menu sends element to back: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Send to back' in context menu sends element to back: [end of test] number of renders 1`] = `14`;+exports[`contextMenu element selecting 'Send to back' in context menu sends element to back: [end of test] number of renders 1`] = `15`;exports[`contextMenu element selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] appState 1`] = `Object {@@ -3595,6 +3606,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -3621,9 +3633,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3966,7 +3978,7 @@ Object {exports[`contextMenu element selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of renders 1`] = `17`;+exports[`contextMenu element selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of renders 1`] = `18`;exports[`contextMenu element shows 'Group selection' in context menu for multiple selected elements: [end of test] appState 1`] = `Object {@@ -4015,6 +4027,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4043,9 +4056,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4246,7 +4259,7 @@ Object {exports[`contextMenu element shows 'Group selection' in context menu for multiple selected elements: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element shows 'Group selection' in context menu for multiple selected elements: [end of test] number of renders 1`] = `17`;+exports[`contextMenu element shows 'Group selection' in context menu for multiple selected elements: [end of test] number of renders 1`] = `18`;exports[`contextMenu element shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] appState 1`] = `Object {@@ -4295,6 +4308,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4325,9 +4339,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4607,7 +4621,7 @@ Object {exports[`contextMenu element shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of elements 1`] = `2`;-exports[`contextMenu element shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of renders 1`] = `18`;+exports[`contextMenu element shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of renders 1`] = `19`;exports[`contextMenu element shows context menu for canvas: [end of test] appState 1`] = `Object {@@ -4656,6 +4670,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4676,9 +4691,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4715,7 +4730,7 @@ Object {exports[`contextMenu element shows context menu for canvas: [end of test] number of elements 1`] = `0`;-exports[`contextMenu element shows context menu for canvas: [end of test] number of renders 1`] = `3`;+exports[`contextMenu element shows context menu for canvas: [end of test] number of renders 1`] = `4`;exports[`contextMenu element shows context menu for element: [end of test] appState 1`] = `Object {@@ -4764,6 +4779,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4786,9 +4802,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4850,6 +4866,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 20,"offsetTop": 10,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4872,9 +4889,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -5060,6 +5077,6 @@ exports[`contextMenu element shows context menu for element: [end of test] numbeexports[`contextMenu element shows context menu for element: [end of test] number of elements 2`] = `2`;-exports[`contextMenu element shows context menu for element: [end of test] number of renders 1`] = `9`;+exports[`contextMenu element shows context menu for element: [end of test] number of renders 1`] = `10`;-exports[`contextMenu element shows context menu for element: [end of test] number of renders 2`] = `6`;+exports[`contextMenu element shows context menu for element: [end of test] number of renders 2`] = `7`;diff --git a/src/tests/__snapshots__/regressionTests.test.tsx.snap b/src/tests/__snapshots__/regressionTests.test.tsx.snapindex 834015acb1..68ae317877 100644--- a/src/tests/__snapshots__/regressionTests.test.tsx.snap+++ b/src/tests/__snapshots__/regressionTests.test.tsx.snap@@ -47,6 +47,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -80,9 +81,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -509,7 +510,7 @@ Object {exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of elements 1`] = `3`;-exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of renders 1`] = `27`;+exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of renders 1`] = `28`;exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] appState 1`] = `Object {@@ -558,6 +559,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -598,9 +600,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1026,7 +1028,7 @@ Object {exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of elements 1`] = `3`;-exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of renders 1`] = `23`;+exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of renders 1`] = `24`;exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] appState 1`] = `Object {@@ -1075,6 +1077,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1098,9 +1101,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1888,7 +1891,7 @@ Object {exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of elements 1`] = `3`;-exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of renders 1`] = `42`;+exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of renders 1`] = `43`;exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] appState 1`] = `Object {@@ -1937,6 +1940,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -1947,9 +1951,7 @@ Object {"penDetected": false,"penMode": false,"pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- },+ "previousSelectedElementIds": Object {},"resizingElement": null,"scrollX": 0,"scrollY": 0,@@ -1962,9 +1964,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -1986,7 +1988,7 @@ Object {"boundElements": null,"fillStyle": "hachure","groupIds": Array [],- "height": 10,+ "height": 15,"id": "id0","isDeleted": false,"link": null,@@ -2002,9 +2004,9 @@ Object {"updated": 1,"version": 3,"versionNonce": 453191,- "width": 10,- "x": 25,- "y": 25,+ "width": 15,+ "x": 10,+ "y": 10,}`;@@ -2083,7 +2085,7 @@ Object {"boundElements": null,"fillStyle": "hachure","groupIds": Array [],- "height": 10,+ "height": 15,"id": "id0","isDeleted": false,"link": null,@@ -2099,9 +2101,9 @@ Object {"updated": 1,"version": 3,"versionNonce": 453191,- "width": 10,- "x": 25,- "y": 25,+ "width": 15,+ "x": 10,+ "y": 10,},],},@@ -2111,7 +2113,7 @@ Object {exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of elements 1`] = `1`;-exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of renders 1`] = `11`;+exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of renders 1`] = `12`;exports[`regression tests adjusts z order when grouping: [end of test] appState 1`] = `Object {@@ -2160,6 +2162,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -2190,9 +2193,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -2619,7 +2622,7 @@ Object {exports[`regression tests adjusts z order when grouping: [end of test] number of elements 1`] = `3`;-exports[`regression tests adjusts z order when grouping: [end of test] number of renders 1`] = `21`;+exports[`regression tests adjusts z order when grouping: [end of test] number of renders 1`] = `22`;exports[`regression tests alt-drag duplicates an element: [end of test] appState 1`] = `Object {@@ -2668,6 +2671,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -2678,9 +2682,7 @@ Object {"penDetected": false,"penMode": false,"pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- },+ "previousSelectedElementIds": Object {},"resizingElement": null,"scrollX": 0,"scrollY": 0,@@ -2693,9 +2695,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -2711,35 +2713,6 @@ Object {`;exports[`regression tests alt-drag duplicates an element: [end of test] element 0 1`] = `-Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0_copy",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 401146281,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 4,- "versionNonce": 2019559783,- "width": 10,- "x": 10,- "y": 10,-}-`;--exports[`regression tests alt-drag duplicates an element: [end of test] element 1 1`] = `Object {"angle": 0,"backgroundColor": "transparent",@@ -2760,11 +2733,11 @@ Object {"strokeWidth": 1,"type": "rectangle","updated": 1,- "version": 3,- "versionNonce": 453191,+ "version": 2,+ "versionNonce": 1278240551,"width": 10,- "x": 20,- "y": 20,+ "x": 10,+ "y": 10,}`;@@ -2824,80 +2797,13 @@ Object {},],},- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {- "id0": true,- "id1": true,- },- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0_copy",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 401146281,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 4,- "versionNonce": 2019559783,- "width": 10,- "x": 10,- "y": 10,- },- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 3,- "versionNonce": 453191,- "width": 10,- "x": 20,- "y": 20,- },- ],- },],}`;-exports[`regression tests alt-drag duplicates an element: [end of test] number of elements 1`] = `2`;+exports[`regression tests alt-drag duplicates an element: [end of test] number of elements 1`] = `1`;-exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `11`;+exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `12`;exports[`regression tests arrow keys: [end of test] appState 1`] = `Object {@@ -2946,6 +2852,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -2968,9 +2875,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3076,7 +2983,7 @@ Object {exports[`regression tests arrow keys: [end of test] number of elements 1`] = `1`;-exports[`regression tests arrow keys: [end of test] number of renders 1`] = `20`;+exports[`regression tests arrow keys: [end of test] number of renders 1`] = `21`;exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] appState 1`] = `Object {@@ -3125,6 +3032,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -3150,9 +3058,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3567,7 +3475,7 @@ Object {exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of elements 1`] = `3`;-exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of renders 1`] = `19`;+exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of renders 1`] = `20`;exports[`regression tests change the properties of a shape: [end of test] appState 1`] = `Object {@@ -3616,6 +3524,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": "strokeColorPicker","openSidebar": null,@@ -3638,9 +3547,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -3826,230 +3735,7 @@ Object {exports[`regression tests change the properties of a shape: [end of test] number of elements 1`] = `1`;-exports[`regression tests change the properties of a shape: [end of test] number of renders 1`] = `14`;--exports[`regression tests click on an element and drag it: [dragged] appState 1`] = `-Object {- "activeTool": Object {- "customType": null,- "lastActiveToolBeforeEraser": null,- "locked": false,- "type": "selection",- },- "collaborators": Map {},- "currentChartType": "bar",- "currentItemBackgroundColor": "transparent",- "currentItemEndArrowhead": "arrow",- "currentItemFillStyle": "hachure",- "currentItemFontFamily": 1,- "currentItemFontSize": 20,- "currentItemLinearStrokeSharpness": "round",- "currentItemOpacity": 100,- "currentItemRoughness": 1,- "currentItemStartArrowhead": null,- "currentItemStrokeColor": "#000000",- "currentItemStrokeSharpness": "sharp",- "currentItemStrokeStyle": "solid",- "currentItemStrokeWidth": 1,- "currentItemTextAlign": "left",- "cursorButton": "up",- "draggingElement": null,- "editingElement": null,- "editingGroupId": null,- "editingLinearElement": null,- "errorMessage": null,- "exportBackground": true,- "exportEmbedScene": false,- "exportScale": 1,- "exportWithDarkMode": false,- "fileHandle": null,- "gridSize": null,- "height": 768,- "isBindingEnabled": true,- "isLoading": false,- "isResizing": false,- "isRotating": false,- "isSidebarDocked": false,- "lastPointerDownWith": "mouse",- "multiElement": null,- "name": "Untitled-201933152653",- "offsetLeft": 0,- "offsetTop": 0,- "openMenu": null,- "openPopup": null,- "openSidebar": null,- "pasteDialog": Object {- "data": null,- "shown": false,- },- "penDetected": false,- "penMode": false,- "pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- },- "resizingElement": null,- "scrollX": 0,- "scrollY": 0,- "scrolledOutside": false,- "selectedElementIds": Object {- "id0": true,- "id1": true,- },- "selectedGroupIds": Object {},- "selectedLinearElement": null,- "selectionElement": null,- "shouldCacheIgnoreZoom": false,- "showHelpDialog": false,- "showHyperlinkPopup": false,- "showStats": false,- "startBoundElement": null,- "suggestedBindings": Array [],- "theme": "light",- "toast": null,- "viewBackgroundColor": "#ffffff",- "viewModeEnabled": false,- "width": 1024,- "zenModeEnabled": false,- "zoom": Object {- "value": 1,- },-}-`;--exports[`regression tests click on an element and drag it: [dragged] element 0 1`] = `-Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 3,- "versionNonce": 453191,- "width": 10,- "x": 20,- "y": 20,-}-`;--exports[`regression tests click on an element and drag it: [dragged] history 1`] = `-Object {- "recording": false,- "redoStack": Array [],- "stateHistory": Array [- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {},- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [],- },- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {- "id0": true,- },- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 2,- "versionNonce": 1278240551,- "width": 10,- "x": 10,- "y": 10,- },- ],- },- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {- "id0": true,- "id1": true,- },- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 3,- "versionNonce": 453191,- "width": 10,- "x": 20,- "y": 20,- },- ],- },- ],-}-`;--exports[`regression tests click on an element and drag it: [dragged] number of elements 1`] = `1`;--exports[`regression tests click on an element and drag it: [dragged] number of renders 1`] = `11`;+exports[`regression tests change the properties of a shape: [end of test] number of renders 1`] = `15`;exports[`regression tests click on an element and drag it: [end of test] appState 1`] = `Object {@@ -4098,6 +3784,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4108,10 +3795,7 @@ Object {"penDetected": false,"penMode": false,"pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- "id1": true,- },+ "previousSelectedElementIds": Object {},"resizingElement": null,"scrollX": 0,"scrollY": 0,@@ -4119,15 +3803,14 @@ Object {"selectedElementIds": Object {"id0": true,"id1": true,- "id2": true,},"selectedGroupIds": Object {},"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4163,8 +3846,8 @@ Object {"strokeWidth": 1,"type": "rectangle","updated": 1,- "version": 4,- "versionNonce": 2019559783,+ "version": 2,+ "versionNonce": 1278240551,"width": 10,"x": 10,"y": 10,@@ -4227,96 +3910,13 @@ Object {},],},- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {- "id0": true,- "id1": true,- },- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 3,- "versionNonce": 453191,- "width": 10,- "x": 20,- "y": 20,- },- ],- },- Object {- "appState": Object {- "editingGroupId": null,- "editingLinearElement": null,- "name": "Untitled-201933152653",- "selectedElementIds": Object {- "id0": true,- "id1": true,- "id2": true,- },- "selectedGroupIds": Object {},- "viewBackgroundColor": "#ffffff",- },- "elements": Array [- Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 10,- "id": "id0",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 337897,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "rectangle",- "updated": 1,- "version": 4,- "versionNonce": 2019559783,- "width": 10,- "x": 10,- "y": 10,- },- ],- },],}`;exports[`regression tests click on an element and drag it: [end of test] number of elements 1`] = `1`;-exports[`regression tests click on an element and drag it: [end of test] number of renders 1`] = `14`;+exports[`regression tests click on an element and drag it: [end of test] number of renders 1`] = `12`;exports[`regression tests click to select a shape: [end of test] appState 1`] = `Object {@@ -4365,6 +3965,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4390,9 +3991,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4593,7 +4194,7 @@ Object {exports[`regression tests click to select a shape: [end of test] number of elements 1`] = `2`;-exports[`regression tests click to select a shape: [end of test] number of renders 1`] = `14`;+exports[`regression tests click to select a shape: [end of test] number of renders 1`] = `15`;exports[`regression tests click-drag to select a group: [end of test] appState 1`] = `Object {@@ -4642,6 +4243,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -4668,9 +4270,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -4992,7 +4594,7 @@ Object {exports[`regression tests click-drag to select a group: [end of test] number of elements 1`] = `3`;-exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `20`;+exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `21`;exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `Object {@@ -5066,6 +4668,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -5115,9 +4718,9 @@ Object {"y": 500,},"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -5318,7 +4921,7 @@ Object {exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of elements 1`] = `2`;-exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `15`;+exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `16`;exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] appState 1`] = `Object {@@ -5392,6 +4995,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -5416,9 +5020,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -5619,7 +5223,7 @@ Object {exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of elements 1`] = `2`;-exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of renders 1`] = `16`;+exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of renders 1`] = `17`;exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `Object {@@ -5693,6 +5297,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -5740,9 +5345,9 @@ Object {"y": 110,},"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -5848,7 +5453,7 @@ Object {exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of elements 1`] = `1`;-exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `9`;+exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `10`;exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] appState 1`] = `Object {@@ -5875,32 +5480,7 @@ Object {"currentItemStrokeWidth": 1,"currentItemTextAlign": "left","cursorButton": "up",- "draggingElement": Object {- "angle": 0,- "backgroundColor": "transparent",- "boundElements": null,- "fillStyle": "hachure",- "groupIds": Array [],- "height": 0,- "id": "id1",- "isDeleted": false,- "link": null,- "locked": false,- "opacity": 100,- "roughness": 1,- "seed": 449462985,- "strokeColor": "#000000",- "strokeSharpness": "sharp",- "strokeStyle": "solid",- "strokeWidth": 1,- "type": "selection",- "updated": 1,- "version": 1,- "versionNonce": 0,- "width": 0,- "x": 100,- "y": 100,- },+ "draggingElement": null,"editingElement": null,"editingGroupId": null,"editingLinearElement": null,@@ -5922,6 +5502,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -5932,21 +5513,22 @@ Object {"penDetected": false,"penMode": false,"pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- },+ "previousSelectedElementIds": Object {},"resizingElement": null,"scrollX": 0,"scrollY": 0,"scrolledOutside": false,- "selectedElementIds": Object {},+ "selectedElementIds": Object {+ "id0": true,+ "id1": true,+ },"selectedGroupIds": Object {},"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -6052,7 +5634,7 @@ Object {exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of elements 1`] = `1`;-exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of renders 1`] = `10`;+exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of renders 1`] = `11`;exports[`regression tests double click to edit a group: [end of test] appState 1`] = `Object {@@ -6101,6 +5683,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -6123,9 +5706,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -6555,7 +6138,7 @@ Object {exports[`regression tests double click to edit a group: [end of test] number of elements 1`] = `3`;-exports[`regression tests double click to edit a group: [end of test] number of renders 1`] = `19`;+exports[`regression tests double click to edit a group: [end of test] number of renders 1`] = `20`;exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] appState 1`] = `Object {@@ -6604,6 +6187,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -6633,9 +6217,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -6905,7 +6489,7 @@ Object {exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of elements 1`] = `2`;-exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of renders 1`] = `17`;+exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of renders 1`] = `18`;exports[`regression tests draw every type of shape: [end of test] appState 1`] = `Object {@@ -6954,6 +6538,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -6976,9 +6561,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -9146,7 +8731,7 @@ Object {exports[`regression tests draw every type of shape: [end of test] number of elements 1`] = `8`;-exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `56`;+exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `57`;exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] appState 1`] = `Object {@@ -9195,6 +8780,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -9222,9 +8808,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -9546,7 +9132,7 @@ Object {exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of elements 1`] = `3`;-exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of renders 1`] = `20`;+exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of renders 1`] = `21`;exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partially overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] appState 1`] = `Object {@@ -9595,6 +9181,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -9623,9 +9210,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -9824,7 +9411,7 @@ Object {exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partially overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of elements 1`] = `2`;-exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partially overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of renders 1`] = `18`;+exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partially overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of renders 1`] = `19`;exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] appState 1`] = `Object {@@ -9873,6 +9460,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -9899,9 +9487,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -10063,7 +9651,7 @@ Object {exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of elements 1`] = `2`;-exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of renders 1`] = `11`;+exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of renders 1`] = `12`;exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] appState 1`] = `Object {@@ -10112,6 +9700,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -10139,9 +9728,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -10371,7 +9960,7 @@ Object {exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of elements 1`] = `2`;-exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of renders 1`] = `12`;+exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of renders 1`] = `13`;exports[`regression tests key 2 selects rectangle tool: [end of test] appState 1`] = `Object {@@ -10420,6 +10009,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -10442,9 +10032,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -10550,7 +10140,7 @@ Object {exports[`regression tests key 2 selects rectangle tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 2 selects rectangle tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key 2 selects rectangle tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key 3 selects diamond tool: [end of test] appState 1`] = `Object {@@ -10599,6 +10189,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -10621,9 +10212,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -10729,7 +10320,7 @@ Object {exports[`regression tests key 3 selects diamond tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 3 selects diamond tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key 3 selects diamond tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key 4 selects ellipse tool: [end of test] appState 1`] = `Object {@@ -10778,6 +10369,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -10800,9 +10392,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -10908,7 +10500,7 @@ Object {exports[`regression tests key 4 selects ellipse tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 4 selects ellipse tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key 4 selects ellipse tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key 5 selects arrow tool: [end of test] appState 1`] = `Object {@@ -10957,6 +10549,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -10996,9 +10589,9 @@ Object {},"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -11134,7 +10727,7 @@ Object {exports[`regression tests key 5 selects arrow tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 5 selects arrow tool: [end of test] number of renders 1`] = `9`;+exports[`regression tests key 5 selects arrow tool: [end of test] number of renders 1`] = `10`;exports[`regression tests key 6 selects line tool: [end of test] appState 1`] = `Object {@@ -11183,6 +10776,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -11222,9 +10816,9 @@ Object {},"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -11360,7 +10954,7 @@ Object {exports[`regression tests key 6 selects line tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 6 selects line tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key 6 selects line tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key 7 selects freedraw tool: [end of test] appState 1`] = `Object {@@ -11409,6 +11003,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -11431,9 +11026,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -11587,7 +11182,7 @@ Object {exports[`regression tests key 7 selects freedraw tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key 7 selects freedraw tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key 7 selects freedraw tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key a selects arrow tool: [end of test] appState 1`] = `Object {@@ -11636,6 +11231,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -11675,9 +11271,9 @@ Object {},"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -11813,7 +11409,7 @@ Object {exports[`regression tests key a selects arrow tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key a selects arrow tool: [end of test] number of renders 1`] = `9`;+exports[`regression tests key a selects arrow tool: [end of test] number of renders 1`] = `10`;exports[`regression tests key d selects diamond tool: [end of test] appState 1`] = `Object {@@ -11862,6 +11458,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -11884,9 +11481,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -11992,7 +11589,7 @@ Object {exports[`regression tests key d selects diamond tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key d selects diamond tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key d selects diamond tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key l selects line tool: [end of test] appState 1`] = `Object {@@ -12041,6 +11638,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -12080,9 +11678,9 @@ Object {},"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -12218,7 +11816,7 @@ Object {exports[`regression tests key l selects line tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key l selects line tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key l selects line tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key o selects ellipse tool: [end of test] appState 1`] = `Object {@@ -12267,6 +11865,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -12289,9 +11888,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -12397,7 +11996,7 @@ Object {exports[`regression tests key o selects ellipse tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key o selects ellipse tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key o selects ellipse tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key r selects rectangle tool: [end of test] appState 1`] = `Object {@@ -12446,6 +12045,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -12468,9 +12068,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -12576,7 +12176,7 @@ Object {exports[`regression tests key r selects rectangle tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key r selects rectangle tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key r selects rectangle tool: [end of test] number of renders 1`] = `9`;exports[`regression tests key x selects freedraw tool: [end of test] appState 1`] = `Object {@@ -12625,6 +12225,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -12647,9 +12248,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -12803,7 +12404,7 @@ Object {exports[`regression tests key x selects freedraw tool: [end of test] number of elements 1`] = `1`;-exports[`regression tests key x selects freedraw tool: [end of test] number of renders 1`] = `8`;+exports[`regression tests key x selects freedraw tool: [end of test] number of renders 1`] = `9`;exports[`regression tests make a group and duplicate it: [end of test] appState 1`] = `Object {@@ -12852,6 +12453,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -12885,9 +12487,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -13599,7 +13201,7 @@ Object {exports[`regression tests make a group and duplicate it: [end of test] number of elements 1`] = `6`;-exports[`regression tests make a group and duplicate it: [end of test] number of renders 1`] = `23`;+exports[`regression tests make a group and duplicate it: [end of test] number of renders 1`] = `24`;exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] appState 1`] = `Object {@@ -13648,6 +13250,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -13674,9 +13277,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -13877,7 +13480,7 @@ Object {exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of elements 1`] = `2`;-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `20`;+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `21`;exports[`regression tests pinch-to-zoom works: [end of test] appState 1`] = `Object {@@ -13926,6 +13529,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -13948,9 +13552,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": true,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -13987,7 +13591,7 @@ Object {exports[`regression tests pinch-to-zoom works: [end of test] number of elements 1`] = `0`;-exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `10`;+exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `11`;exports[`regression tests rerenders UI on language change: [end of test] appState 1`] = `Object {@@ -14036,6 +13640,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -14056,9 +13661,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -14095,7 +13700,7 @@ Object {exports[`regression tests rerenders UI on language change: [end of test] number of elements 1`] = `0`;-exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `9`;+exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `6`;exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] appState 1`] = `Object {@@ -14144,6 +13749,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -14154,24 +13760,22 @@ Object {"penDetected": false,"penMode": false,"pendingImageElementId": null,- "previousSelectedElementIds": Object {- "id0": true,- },+ "previousSelectedElementIds": Object {},"resizingElement": null,"scrollX": 0,"scrollY": 0,"scrolledOutside": false,"selectedElementIds": Object {- "id0": false,+ "id0": true,"id1": true,},"selectedGroupIds": Object {},"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -14277,7 +13881,7 @@ Object {exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of elements 1`] = `1`;-exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of renders 1`] = `10`;+exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of renders 1`] = `11`;exports[`regression tests shift-click to multiselect, then drag: [end of test] appState 1`] = `Object {@@ -14326,6 +13930,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -14357,9 +13962,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -14630,7 +14235,7 @@ Object {exports[`regression tests shift-click to multiselect, then drag: [end of test] number of elements 1`] = `2`;-exports[`regression tests shift-click to multiselect, then drag: [end of test] number of renders 1`] = `19`;+exports[`regression tests shift-click to multiselect, then drag: [end of test] number of renders 1`] = `20`;exports[`regression tests should group elements and ungroup them: [end of test] appState 1`] = `Object {@@ -14679,6 +14284,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -14707,9 +14313,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -15230,7 +14836,7 @@ Object {exports[`regression tests should group elements and ungroup them: [end of test] number of elements 1`] = `3`;-exports[`regression tests should group elements and ungroup them: [end of test] number of renders 1`] = `24`;+exports[`regression tests should group elements and ungroup them: [end of test] number of renders 1`] = `25`;exports[`regression tests should show fill icons when element has non transparent background: [end of test] appState 1`] = `Object {@@ -15279,6 +14885,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -15301,9 +14908,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -15449,7 +15056,7 @@ Object {exports[`regression tests should show fill icons when element has non transparent background: [end of test] number of elements 1`] = `1`;-exports[`regression tests should show fill icons when element has non transparent background: [end of test] number of renders 1`] = `13`;+exports[`regression tests should show fill icons when element has non transparent background: [end of test] number of renders 1`] = `14`;exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] appState 1`] = `Object {@@ -15498,6 +15105,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -15531,9 +15139,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -16363,7 +15971,7 @@ Object {exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of elements 1`] = `4`;-exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of renders 1`] = `38`;+exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of renders 1`] = `39`;exports[`regression tests spacebar + drag scrolls the canvas: [end of test] appState 1`] = `Object {@@ -16412,6 +16020,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -16432,9 +16041,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -16471,7 +16080,7 @@ Object {exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of elements 1`] = `0`;-exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `7`;+exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `8`;exports[`regression tests supports nested groups: [end of test] appState 1`] = `Object {@@ -16520,6 +16129,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -16544,9 +16154,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -17287,7 +16897,7 @@ Object {exports[`regression tests supports nested groups: [end of test] number of elements 1`] = `3`;-exports[`regression tests supports nested groups: [end of test] number of renders 1`] = `31`;+exports[`regression tests supports nested groups: [end of test] number of renders 1`] = `32`;exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] appState 1`] = `Object {@@ -17361,6 +16971,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -17412,9 +17023,9 @@ Object {"y": 0,},"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -17736,7 +17347,7 @@ Object {exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of elements 1`] = `3`;-exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of renders 1`] = `19`;+exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of renders 1`] = `20`;exports[`regression tests switches selected element on pointer down: [end of test] appState 1`] = `Object {@@ -17810,6 +17421,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -17859,9 +17471,9 @@ Object {"y": 0,},"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -18062,7 +17674,7 @@ Object {exports[`regression tests switches selected element on pointer down: [end of test] number of elements 1`] = `2`;-exports[`regression tests switches selected element on pointer down: [end of test] number of renders 1`] = `13`;+exports[`regression tests switches selected element on pointer down: [end of test] number of renders 1`] = `14`;exports[`regression tests two-finger scroll works: [end of test] appState 1`] = `Object {@@ -18111,6 +17723,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -18133,9 +17746,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": true,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -18172,7 +17785,7 @@ Object {exports[`regression tests two-finger scroll works: [end of test] number of elements 1`] = `0`;-exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `12`;+exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `13`;exports[`regression tests undo/redo drawing an element: [end of test] appState 1`] = `Object {@@ -18221,6 +17834,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -18243,9 +17857,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -18718,7 +18332,7 @@ Object {exports[`regression tests undo/redo drawing an element: [end of test] number of elements 1`] = `3`;-exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `30`;+exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `31`;exports[`regression tests updates fontSize & fontFamily appState: [end of test] appState 1`] = `Object {@@ -18767,6 +18381,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -18787,9 +18402,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -18826,7 +18441,7 @@ Object {exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of elements 1`] = `0`;-exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of renders 1`] = `6`;+exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of renders 1`] = `7`;exports[`regression tests zoom hotkeys: [end of test] appState 1`] = `Object {@@ -18875,6 +18490,7 @@ Object {"name": "Untitled-201933152653","offsetLeft": 0,"offsetTop": 0,+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -18895,9 +18511,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": true,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",@@ -18934,4 +18550,4 @@ Object {exports[`regression tests zoom hotkeys: [end of test] number of elements 1`] = `0`;-exports[`regression tests zoom hotkeys: [end of test] number of renders 1`] = `6`;+exports[`regression tests zoom hotkeys: [end of test] number of renders 1`] = `7`;diff --git a/src/tests/clients.test.ts b/src/tests/clients.test.tsindex 61594fc7ae..f3fd174b4d 100644--- a/src/tests/clients.test.ts+++ b/src/tests/clients.test.ts@@ -3,17 +3,17 @@ import { getClientInitials } from "../clients";describe("getClientInitials", () => {it("returns substring if one name provided", () => {const result = getClientInitials("Alan");- expect(result).toBe("AL");+ expect(result).toBe("A");});it("returns initials", () => {const result = getClientInitials("John Doe");- expect(result).toBe("JD");+ expect(result).toBe("J");});it("returns correct initials if many names provided", () => {const result = getClientInitials("John Alan Doe");- expect(result).toBe("JD");+ expect(result).toBe("J");});it("returns single initial if 1 letter provided", () => {diff --git a/src/tests/linearElementEditor.test.tsx b/src/tests/linearElementEditor.test.tsxindex 4b3f795ced..122bd135ce 100644--- a/src/tests/linearElementEditor.test.tsx+++ b/src/tests/linearElementEditor.test.tsx@@ -126,12 +126,12 @@ describe(" Test Linear Elements", () => {createTwoPointerLinearElement("line");const line = h.elements[0] as ExcalidrawLinearElement;- expect(renderScene).toHaveBeenCalledTimes(6);+ expect(renderScene).toHaveBeenCalledTimes(7);expect((h.elements[0] as ExcalidrawLinearElement).points.length).toEqual(2);// drag line from midpointdrag(midpoint, [midpoint[0] + delta, midpoint[1] + delta]);- expect(renderScene).toHaveBeenCalledTimes(9);+ expect(renderScene).toHaveBeenCalledTimes(10);expect(line.points.length).toEqual(3);expect(line.points).toMatchInlineSnapshot(`Array [@@ -196,7 +196,7 @@ describe(" Test Linear Elements", () => {// drag line from midpointdrag(midpoint, [midpoint[0] + delta, midpoint[1] + delta]);- expect(renderScene).toHaveBeenCalledTimes(13);+ expect(renderScene).toHaveBeenCalledTimes(14);expect(line.points.length).toEqual(3);expect(line.points).toMatchInlineSnapshot(`@@ -233,7 +233,7 @@ describe(" Test Linear Elements", () => {// update sharpnessfireEvent.click(screen.getByTitle("Round"));- expect(renderScene).toHaveBeenCalledTimes(11);+ expect(renderScene).toHaveBeenCalledTimes(12);const midPointsWithRoundEdge = LinearElementEditor.getEditorMidPoints(h.elements[0] as ExcalidrawLinearElement,h.state,@@ -275,7 +275,7 @@ describe(" Test Linear Elements", () => {// Move the elementdrag(startPoint, endPoint);- expect(renderScene).toHaveBeenCalledTimes(14);+ expect(renderScene).toHaveBeenCalledTimes(15);expect([line.x, line.y]).toEqual([points[0][0] + deltaX,points[0][1] + deltaY,@@ -332,7 +332,7 @@ describe(" Test Linear Elements", () => {lastSegmentMidpoint[1] + delta,]);- expect(renderScene).toHaveBeenCalledTimes(18);+ expect(renderScene).toHaveBeenCalledTimes(19);expect(line.points.length).toEqual(5);expect((h.elements[0] as ExcalidrawLinearElement).points)@@ -371,7 +371,7 @@ describe(" Test Linear Elements", () => {// Drag from first pointdrag(hitCoords, [hitCoords[0] - delta, hitCoords[1] - delta]);- expect(renderScene).toHaveBeenCalledTimes(14);+ expect(renderScene).toHaveBeenCalledTimes(15);const newPoints = LinearElementEditor.getPointsGlobalCoordinates(line);expect([newPoints[0][0], newPoints[0][1]]).toEqual([@@ -397,7 +397,7 @@ describe(" Test Linear Elements", () => {// Drag from first pointdrag(hitCoords, [hitCoords[0] + delta, hitCoords[1] + delta]);- expect(renderScene).toHaveBeenCalledTimes(14);+ expect(renderScene).toHaveBeenCalledTimes(15);const newPoints = LinearElementEditor.getPointsGlobalCoordinates(line);expect([newPoints[0][0], newPoints[0][1]]).toEqual([@@ -431,7 +431,7 @@ describe(" Test Linear Elements", () => {// delete 3rd pointdeletePoint(points[2]);expect(line.points.length).toEqual(3);- expect(renderScene).toHaveBeenCalledTimes(19);+ expect(renderScene).toHaveBeenCalledTimes(20);const newMidPoints = LinearElementEditor.getEditorMidPoints(line,@@ -476,7 +476,7 @@ describe(" Test Linear Elements", () => {lastSegmentMidpoint[0] + delta,lastSegmentMidpoint[1] + delta,]);- expect(renderScene).toHaveBeenCalledTimes(18);+ expect(renderScene).toHaveBeenCalledTimes(19);expect(line.points.length).toEqual(5);@@ -552,7 +552,7 @@ describe(" Test Linear Elements", () => {// Drag from first pointdrag(hitCoords, [hitCoords[0] + delta, hitCoords[1] + delta]);- expect(renderScene).toHaveBeenCalledTimes(14);+ expect(renderScene).toHaveBeenCalledTimes(15);const newPoints = LinearElementEditor.getPointsGlobalCoordinates(line);expect([newPoints[0][0], newPoints[0][1]]).toEqual([diff --git a/src/tests/packages/__snapshots__/excalidraw.test.tsx.snap b/src/tests/packages/__snapshots__/excalidraw.test.tsx.snapindex c2af99ea3f..0d8e27282e 100644--- a/src/tests/packages/__snapshots__/excalidraw.test.tsx.snap+++ b/src/tests/packages/__snapshots__/excalidraw.test.tsx.snap@@ -3,7 +3,6 @@exports[`<Excalidraw/> Test UIOptions prop Test canvasActions should not hide any UI element when canvasActions is "undefined" 1`] = `<sectionaria-labelledby="test-id-canvasActions-title"- class="zen-mode-transition"><h2class="visually-hidden"@@ -12,75 +11,97 @@ exports[`<Excalidraw/> Test UIOptions prop Test canvasActions should not hide anCanvas actions</h2><div- class="Island"- style="--padding: 2; z-index: 1;"+ class="Stack Stack_vertical zoom-actions"+ style="--gap: 1;"><div- class="Stack Stack_vertical"- style="--gap: 4;"+ class="Stack Stack_horizontal"+ style="align-items: center;">+ <button+ aria-label="Zoom out"+ class="ToolIcon_type_button ToolIcon_size_medium zoom-out-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Zoom out — Ctrl+-"+ type="button"+ >+ <div+ aria-hidden="true"+ class="ToolIcon__icon"+ >+ <svg+ aria-hidden="true"+ class=""+ fill="none"+ focusable="false"+ role="img"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"+ >+ <path+ d="M5 10h10"+ stroke-width="1.25"+ />+ </svg>+ </div>+ </button><div- class="Stack Stack_horizontal"- style="--gap: 1; justify-content: space-between;"+ class="excalidraw-tooltip-wrapper"+ style="height: 100%;"><button- aria-label="Reset the canvas"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="clear-canvas-button"- title="Reset the canvas"+ aria-label="Reset zoom"+ class="ToolIcon_type_button ToolIcon_size_medium reset-zoom-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Reset zoom"type="button">- <div- aria-hidden="true"- class="ToolIcon__icon"- >- <svg- aria-hidden="true"- class=""- focusable="false"- role="img"- viewBox="0 0 448 512"- >- <path- d="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"- fill="currentColor"- />- </svg>- </div>+ 100+ %</button>+ </div>+ <button+ aria-label="Zoom in"+ class="ToolIcon_type_button ToolIcon_size_medium zoom-in-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Zoom in — Ctrl++"+ type="button"+ ><div- style="width: .625em;"- />- <button- aria-label="Load"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="load-button"- title="Load"- type="button"+ aria-hidden="true"+ class="ToolIcon__icon">- <div+ <svgaria-hidden="true"- class="ToolIcon__icon"+ class=""+ fill="none"+ focusable="false"+ role="img"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20">- <svg- aria-hidden="true"- class="rtl-mirror"- focusable="false"- role="img"- viewBox="0 0 576 512"- >- <path- d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"- fill="currentColor"- />- </svg>- </div>- </button>+ <path+ d="M10 4.167v11.666M4.167 10h11.666"+ stroke-width="1.25"+ />+ </svg>+ </div>+ </button>+ </div>+ </div>+ <div+ class="undo-redo-buttons zen-mode-transition"+ >+ <div+ class="undo-button-container"+ >+ <div+ class="excalidraw-tooltip-wrapper"+ ><button- aria-label="Export"+ aria-label="Undo"class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="json-export-button"- title="Export"type="button"><div@@ -89,23 +110,34 @@ exports[`<Excalidraw/> Test UIOptions prop Test canvasActions should not hide an><svgaria-hidden="true"- class="rtl-mirror"+ class=""+ fill="none"focusable="false"role="img"- viewBox="0 0 576 512"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"><path- d="M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z"- fill="currentColor"+ d="M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5"+ stroke-width="1.25"/></svg></div></button>+ </div>+ </div>+ <div+ class="redo-button-container"+ >+ <div+ class="excalidraw-tooltip-wrapper"+ >+<button- aria-label="Save as image"+ aria-label="Redo"class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="image-export-button"- title="Save as image"type="button"><div@@ -114,85 +146,22 @@ exports[`<Excalidraw/> Test UIOptions prop Test canvasActions should not hide an><svgaria-hidden="true"- class="rtl-mirror"+ class=""+ fill="none"focusable="false"role="img"- viewBox="0 0 576 512"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"><path- d="M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"- />- <path- d="M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"+ d="M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5"+ stroke-width="1.25"/></svg></div></button>- <div- style="width: .625em;"- />- </div>- <div- style="display: flex;"- >- <div- style="position: relative;"- >- <div>- <div- class="color-picker-control-container"- >- <button- aria-label="Canvas background"- class="color-picker-label-swatch"- style="--swatch-color: #ffffff;"- />- <label- class="color-input-container"- >- <div- class="color-picker-hash"- >- #- </div>- <input- aria-label="Canvas background"- class="color-picker-input"- spellcheck="false"- value="ffffff"- />- </label>- </div>- </div>- </div>- <div- style="margin-inline-start: 0.25rem;"- >- <button- aria-label="Dark mode"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon ToolIcon--plain"- data-testid="toggle-dark-mode"- title="Dark mode"- type="button"- >- <div- aria-hidden="true"- class="ToolIcon__icon"- >- <svg- class="rtl-mirror"- height="512"- viewBox="0 0 512 512"- width="512"- >- <path- d="M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"- fill="currentColor"- />- </svg>- </div>- </button>- </div></div></div></div>@@ -202,7 +171,6 @@ exports[`<Excalidraw/> Test UIOptions prop Test canvasActions should not hide anexports[`<Excalidraw/> Test UIOptions prop should not hide any UI element when the UIOptions prop is "undefined" 1`] = `<sectionaria-labelledby="test-id-canvasActions-title"- class="zen-mode-transition"><h2class="visually-hidden"@@ -211,75 +179,97 @@ exports[`<Excalidraw/> Test UIOptions prop should not hide any UI element when tCanvas actions</h2><div- class="Island"- style="--padding: 2; z-index: 1;"+ class="Stack Stack_vertical zoom-actions"+ style="--gap: 1;"><div- class="Stack Stack_vertical"- style="--gap: 4;"+ class="Stack Stack_horizontal"+ style="align-items: center;">+ <button+ aria-label="Zoom out"+ class="ToolIcon_type_button ToolIcon_size_medium zoom-out-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Zoom out — Ctrl+-"+ type="button"+ >+ <div+ aria-hidden="true"+ class="ToolIcon__icon"+ >+ <svg+ aria-hidden="true"+ class=""+ fill="none"+ focusable="false"+ role="img"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"+ >+ <path+ d="M5 10h10"+ stroke-width="1.25"+ />+ </svg>+ </div>+ </button><div- class="Stack Stack_horizontal"- style="--gap: 1; justify-content: space-between;"+ class="excalidraw-tooltip-wrapper"+ style="height: 100%;"><button- aria-label="Reset the canvas"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="clear-canvas-button"- title="Reset the canvas"+ aria-label="Reset zoom"+ class="ToolIcon_type_button ToolIcon_size_medium reset-zoom-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Reset zoom"type="button">- <div- aria-hidden="true"- class="ToolIcon__icon"- >- <svg- aria-hidden="true"- class=""- focusable="false"- role="img"- viewBox="0 0 448 512"- >- <path- d="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"- fill="currentColor"- />- </svg>- </div>+ 100+ %</button>+ </div>+ <button+ aria-label="Zoom in"+ class="ToolIcon_type_button ToolIcon_size_medium zoom-in-button zoom-button ToolIcon_type_button--show ToolIcon"+ title="Zoom in — Ctrl++"+ type="button"+ ><div- style="width: .625em;"- />- <button- aria-label="Load"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="load-button"- title="Load"- type="button"+ aria-hidden="true"+ class="ToolIcon__icon">- <div+ <svgaria-hidden="true"- class="ToolIcon__icon"+ class=""+ fill="none"+ focusable="false"+ role="img"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20">- <svg- aria-hidden="true"- class="rtl-mirror"- focusable="false"- role="img"- viewBox="0 0 576 512"- >- <path- d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"- fill="currentColor"- />- </svg>- </div>- </button>+ <path+ d="M10 4.167v11.666M4.167 10h11.666"+ stroke-width="1.25"+ />+ </svg>+ </div>+ </button>+ </div>+ </div>+ <div+ class="undo-redo-buttons zen-mode-transition"+ >+ <div+ class="undo-button-container"+ >+ <div+ class="excalidraw-tooltip-wrapper"+ ><button- aria-label="Export"+ aria-label="Undo"class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="json-export-button"- title="Export"type="button"><div@@ -288,23 +278,34 @@ exports[`<Excalidraw/> Test UIOptions prop should not hide any UI element when t><svgaria-hidden="true"- class="rtl-mirror"+ class=""+ fill="none"focusable="false"role="img"- viewBox="0 0 576 512"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"><path- d="M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z"- fill="currentColor"+ d="M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5"+ stroke-width="1.25"/></svg></div></button>+ </div>+ </div>+ <div+ class="redo-button-container"+ >+ <div+ class="excalidraw-tooltip-wrapper"+ >+<button- aria-label="Save as image"+ aria-label="Redo"class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon"- data-testid="image-export-button"- title="Save as image"type="button"><div@@ -313,85 +314,22 @@ exports[`<Excalidraw/> Test UIOptions prop should not hide any UI element when t><svgaria-hidden="true"- class="rtl-mirror"+ class=""+ fill="none"focusable="false"role="img"- viewBox="0 0 576 512"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ viewBox="0 0 20 20"><path- d="M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"- />- <path- d="M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"+ d="M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5"+ stroke-width="1.25"/></svg></div></button>- <div- style="width: .625em;"- />- </div>- <div- style="display: flex;"- >- <div- style="position: relative;"- >- <div>- <div- class="color-picker-control-container"- >- <button- aria-label="Canvas background"- class="color-picker-label-swatch"- style="--swatch-color: #ffffff;"- />- <label- class="color-input-container"- >- <div- class="color-picker-hash"- >- #- </div>- <input- aria-label="Canvas background"- class="color-picker-input"- spellcheck="false"- value="ffffff"- />- </label>- </div>- </div>- </div>- <div- style="margin-inline-start: 0.25rem;"- >- <button- aria-label="Dark mode"- class="ToolIcon_type_button ToolIcon_size_medium ToolIcon_type_button--show ToolIcon ToolIcon--plain"- data-testid="toggle-dark-mode"- title="Dark mode"- type="button"- >- <div- aria-hidden="true"- class="ToolIcon__icon"- >- <svg- class="rtl-mirror"- height="512"- viewBox="0 0 512 512"- width="512"- >- <path- d="M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"- fill="currentColor"- />- </svg>- </div>- </button>- </div></div></div></div>diff --git a/src/tests/packages/__snapshots__/utils.test.ts.snap b/src/tests/packages/__snapshots__/utils.test.ts.snapindex 4f1b380e75..75397290c6 100644--- a/src/tests/packages/__snapshots__/utils.test.ts.snap+++ b/src/tests/packages/__snapshots__/utils.test.ts.snap@@ -45,6 +45,7 @@ Object {"lastPointerDownWith": "mouse","multiElement": null,"name": "name",+ "openDialog": null,"openMenu": null,"openPopup": null,"openSidebar": null,@@ -65,9 +66,9 @@ Object {"selectedLinearElement": null,"selectionElement": null,"shouldCacheIgnoreZoom": false,- "showHelpDialog": false,"showHyperlinkPopup": false,"showStats": false,+ "showWelcomeScreen": false,"startBoundElement": null,"suggestedBindings": Array [],"theme": "light",diff --git a/src/types.ts b/src/types.tsindex c3f89382fa..52a84ef3c8 100644--- a/src/types.ts+++ b/src/types.ts@@ -78,7 +78,9 @@ export type LastActiveToolBeforeEraser =customType: string;}| null;+export type AppState = {+ showWelcomeScreen: boolean;isLoading: boolean;errorMessage: string | null;draggingElement: NonDeletedExcalidrawElement | null;@@ -141,13 +143,13 @@ export type AppState = {| "strokeColorPicker"| null;openSidebar: "library" | "customSidebar" | null;+ openDialog: "imageExport" | "help" | null;isSidebarDocked: boolean;lastPointerDownWith: PointerType;selectedElementIds: { [id: string]: boolean };previousSelectedElementIds: { [id: string]: boolean };shouldCacheIgnoreZoom: boolean;- showHelpDialog: boolean;toast: { message: string; closable?: boolean; duration?: number } | null;zenModeEnabled: boolean;theme: Theme;