diff --git a/src/components/Sidebar/SidebarHeader.tsx b/src/components/Sidebar/SidebarHeader.tsx
index 3c8ccc12..bb107216 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 = (
-
-);
-
export const SidebarDockButton = (props: {
checked: boolean;
onChange?(): void;
@@ -33,8 +27,13 @@ export const SidebarDockButton = (props: {
checked={props.checked}
aria-label={t("labels.sidebarLock")}
/>{" "}
-
- {SIDE_LIBRARY_TOGGLE_ICON}
+
+ {PinIcon}
{" "}
{" "}
@@ -64,24 +63,19 @@ const _SidebarHeader: React.FC<{
{
- document
- .querySelector(".layer-ui__wrapper")
- ?.classList.add("animate");
-
props.onDock?.(!props.docked);
}}
/>
)}
{renderCloseButton && (
-
-
-
+
)}
)}
diff --git a/src/components/Sidebar/common.ts b/src/components/Sidebar/common.ts
index e2b310b7..97c72b5d 100644
--- a/src/components/Sidebar/common.ts
+++ b/src/components/Sidebar/common.ts
@@ -9,6 +9,7 @@ export type SidebarProps = {
/** 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.tsx
index 2dc81295..45959199 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 = ({
- {close}
+ {CloseIcon}
{t("stats.title")}
diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx
index 56eb94db..be0c4666 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 = ({
{message}
{closable && (
* {
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.tsx
index b9f7a36a..468f1deb 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 ? (
+ //
+ // {avatarJSX}
+ //
+ // ) : (
+ // {avatarJSX}
+ // );
+ // });
+
return (
{avatars}
diff --git a/src/components/WelcomeScreen.scss b/src/components/WelcomeScreen.scss
new file mode 100644
index 00000000..0ccb6380
--- /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.tsx
new file mode 100644
index 00000000..03eb0585
--- /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 (
+
+
+ {icon}
+ {label}
+
+
+ );
+ }
+
+ return (
+
+ );
+};
+
+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 (
+
+ Excalidraw+
+
+ );
+ }
+ return bit;
+ });
+ } else {
+ subheadingJSX = t("welcomeScreen.data");
+ }
+
+ return (
+
+
+ {ExcalLogo} Excalidraw
+
+
+ {subheadingJSX}
+
+
+ actionManager.executeAction(actionLoadScene)}
+ shortcut={getShortcutFromShortcutName("loadScene")}
+ icon={LoadIcon}
+ />
+ setCollabDialogShown(true)}
+ icon={UsersIcon}
+ />
+ actionManager.executeAction(actionShortcuts)}
+ label={t("helpDialog.title")}
+ shortcut="?"
+ icon={HelpIcon}
+ />
+ {!isExcalidrawPlusSignedUser && (
+
+ )}
+
+
+ );
+};
+
+export default WelcomeScreen;
diff --git a/src/components/WelcomeScreenDecor.tsx b/src/components/WelcomeScreenDecor.tsx
new file mode 100644
index 00000000..1c7d6cc8
--- /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.tsx
index 9e0ce7e8..fb438eff 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 (
);
};
+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(
+
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// tabler-icons: book
+export const LibraryIcon = createIcon(
+
+
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// tabler-icons: plus
+export const PlusIcon = createIcon(
+
,
+ tablerIconProps,
+);
+
+// tabler-icons: dots-vertical
+export const DotsIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// tabler-icons: pinned
+export const PinIcon = createIcon(
+
,
+ tablerIconProps,
+);
+
+// tabler-icons: lock-open (via Figma)
+export const UnlockedIcon = createIcon(
+
+
+
+
+
+
+
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+// tabler-icons: lock (via Figma)
+export const LockedIcon = createIcon(
+
+
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+// custom
+export const WelcomeScreenMenuArrow = createIcon(
+ <>
+
+
+
+ >,
+ { width: 41, height: 94, fill: "none" },
+);
+
+// custom
+export const WelcomeScreenHelpArrow = createIcon(
+ <>
+
+
+
+ >,
+ { width: 85, height: 71, fill: "none" },
+);
+
+// custom
+export const WelcomeScreenTopToolbarArrow = createIcon(
+ <>
+
+
+
+ >,
+ { width: 38, height: 78, fill: "none" },
+);
+
+// custom
+export const ExcalLogo = createIcon(
+
+
+
+ ,
+ { width: 26, height: 62, fill: "none" },
+);
+
+// custom
+export const SelectionIcon = createIcon(
+
+
+
+
+ ,
+ { fill: "none", width: 22, height: 22, strokeWidth: 1.25 },
+);
+
+// tabler-icons: square
+export const RectangleIcon = createIcon(
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// tabler-icons: square-rotated
+export const DiamondIcon = createIcon(
+
+
+
+ ,
+
+ tablerIconProps,
+);
+
+// tabler-icons: circle
+export const EllipseIcon = createIcon(
+
+
+
+ ,
+
+ tablerIconProps,
+);
+
+// tabler-icons: arrow-narrow-right
+export const ArrowIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// custom?
+export const LineIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const PenModeIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// modified tabler-icons: pencil
+export const FreedrawIcon = createIcon(
+
+
+
+ ,
+
+ modifiedTablerIconProps,
+);
+
+// tabler-icons: typography
+export const TextIcon = createIcon(
+
+
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// modified tabler-icons: photo
+export const ImageIcon = createIcon(
+
+
+
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+// tabler-icons: eraser
+export const EraserIcon = createIcon(
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+export const ZoomInIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const ZoomOutIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const TrashIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const DuplicateIcon = createIcon(
+
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+export const MoonIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const SunIcon = createIcon(
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+export const HamburgerMenuIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+export const ExportIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const HelpIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+export const ExternalLinkIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const GithubIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const DiscordIcon = createIcon(
+
+
+
+ ,
+ modifiedTablerIconProps,
+);
+
+export const TwitterIcon = createIcon(
+
+
+
+ ,
+ tablerIconProps,
+);
+
export const checkIcon = createIcon(
,
{
@@ -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(
+
+
+
+ ,
+ 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(
+
,
+ 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(
- <>
-
-
- >,
- { width: 576, height: 512, mirror: true },
+export const ExportImageIcon = createIcon(
+
+
+
+
+
+
+
+
+ ,
+ 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(
+
,
+ 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(
+
,
+ 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 },
+
,
+ modifiedTablerIconProps,
);
export const shareIOS = createIcon(
@@ -158,7 +605,6 @@ export const shareIOS = createIcon(
export const shareWindows = createIcon(
<>
@@ -183,84 +629,118 @@ export const resetZoom = createIcon(
{ width: 1024 },
);
-export const BringForwardIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const BringForwardIcon = createIcon(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const SendBackwardIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const SendBackwardIcon = createIcon(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const BringToFrontIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const BringToFrontIcon = createIcon(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const SendToBackIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const SendToBackIcon = createIcon(
+ <>
+
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+
+
+
+
+
+ >,
+ 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(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const AlignBottomIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const AlignBottomIcon = createIcon(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const AlignLeftIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const AlignLeftIcon = createIcon(
+ <>
+
-
- >,
- { width: 24 },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const AlignRightIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const AlignRightIcon = createIcon(
+ <>
+
-
- >,
- { width: 24 },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const DistributeHorizontallyIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
- <>
-
-
- >,
- { width: 24 },
- ),
-);
-
-export const DistributeVerticallyIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
- <>
-
-
- >,
- { width: 24 },
- ),
-);
-
-export const CenterVerticallyIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const DistributeHorizontallyIcon = createIcon(
+ <>
+
-
- >,
- { width: 24, mirror: true },
- ),
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const CenterHorizontallyIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
- <>
-
-
- >,
- { width: 24 },
- ),
+export const DistributeVerticallyIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+
+ >,
+ 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 CenterVerticallyIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const CenterHorizontallyIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const UsersIcon = createIcon(
+
+
+
+
+
+
+ ,
+ 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(
+ <>
+
+
+
+
+
+
+
+
+ >,
+ 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 this
export 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(
+ <>
,
- { width: 40, height: 20 },
- ),
-);
-
-export const FillCrossHatchIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
-
-
- ,
- { width: 40, height: 20 },
- ),
-);
-
-export const FillSolidIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
, {
- width: 40,
- height: 20,
- }),
-);
-
-export const StrokeWidthIcon = React.memo(
- ({ theme, strokeWidth }: { theme: Theme; strokeWidth: number }) =>
- createIcon(
+ 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"
+ />
+
+
+
+ ,
- { width: 40, height: 20 },
- ),
+ strokeLinejoin="round"
+ />
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const FillCrossHatchIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const FillSolidIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+ >,
+ { ...modifiedTablerIconProps, fill: "currentColor" },
+);
+
+export const StrokeWidthBaseIcon = createIcon(
+ <>
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const StrokeWidthBoldIcon = createIcon(
+
,
+ modifiedTablerIconProps,
+);
+
+export const StrokeWidthExtraBoldIcon = createIcon(
+
,
+ 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(
-
,
- { width: 40, height: 20 },
- ),
+export const StrokeStyleDashedIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
);
-export const StrokeStyleDottedIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20 },
- ),
+// tabler-icons: line-dotted
+export const StrokeStyleDottedIcon = createIcon(
+
+
+
+
+
+
+
+ ,
+ tablerIconProps,
);
-export const SloppinessArchitectIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20, mirror: true },
- ),
+export const SloppinessArchitectIcon = createIcon(
+
,
+ modifiedTablerIconProps,
);
-export const SloppinessArtistIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20, mirror: true },
- ),
+export const SloppinessArtistIcon = createIcon(
+
,
+ modifiedTablerIconProps,
);
-export const SloppinessCartoonistIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20, mirror: true },
- ),
+export const SloppinessCartoonistIcon = createIcon(
+
,
+ modifiedTablerIconProps,
);
-export const EdgeSharpIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20, mirror: true },
- ),
+export const EdgeSharpIcon = createIcon(
+
,
+ modifiedTablerIconProps,
);
-export const EdgeRoundIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- { width: 40, height: 20, mirror: true },
- ),
+// tabler-icons: border-radius
+export const EdgeRoundIcon = createIcon(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,
+ tablerIconProps,
);
-export const ArrowheadNoneIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
,
- {
- width: 40,
- height: 20,
- },
- ),
+export const ArrowheadNoneIcon = createIcon(
+
,
+ {
+ width: 40,
+ height: 20,
+ },
);
export const ArrowheadArrowIcon = React.memo(
- ({ theme, flip = false }: { theme: Theme; flip?: boolean }) =>
+ ({ flip = false }: { flip?: boolean }) =>
createIcon(
@@ -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(
@@ -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(
@@ -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(
@@ -773,149 +1331,211 @@ export const ArrowheadTriangleIcon = React.memo(
),
);
-export const FontSizeSmallIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- ,
- { width: 47, height: 77 },
- ),
-);
-
-export const FontSizeMediumIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- ,
- { width: 77, height: 75 },
- ),
-);
-
-export const FontSizeLargeIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- ,
- { width: 45, height: 75 },
- ),
-);
-
-export const FontSizeExtraLargeIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
+export const FontSizeSmallIcon = createIcon(
+ <>
+
,
- { width: 120, height: 75 },
- ),
-);
-
-export const FontFamilyHandDrawnIcon = React.memo(
- ({ theme }: { theme: Theme }) =>
- createIcon(
- ,
- { width: 448, height: 512 },
- ),
-);
-
-export const FontFamilyNormalIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
-
-
- >,
- { width: 70, height: 78 },
- ),
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const FontFamilyCodeIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- <>
+export const FontSizeMediumIcon = createIcon(
+ <>
+
- >,
- { width: 640, height: 512 },
- ),
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
);
-export const TextAlignLeftIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
+export const FontSizeLargeIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const FontSizeExtraLargeIcon = createIcon(
+ <>
,
- { width: 448, height: 512 },
- ),
+ strokeLinejoin="round"
+ />
+ >,
+ modifiedTablerIconProps,
);
-export const TextAlignCenterIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
- ,
- { width: 448, height: 512 },
- ),
-);
-
-export const TextAlignRightIcon = React.memo(({ theme }: { theme: Theme }) =>
- createIcon(
-
+ ,
- { width: 448, height: 512 },
- ),
+ strokeLinejoin="round"
+ >
+
+
+ >,
+ modifiedTablerIconProps,
);
+export const FontFamilyCodeIcon = createIcon(
+ <>
+
+
+
+
+
+
+
+
+ >,
+ modifiedTablerIconProps,
+);
+
+export const TextAlignLeftIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+export const TextAlignCenterIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+export const TextAlignRightIcon = createIcon(
+
+
+
+
+
+ ,
+ tablerIconProps,
+);
+
+// tabler-icons: layout-align-top
export const TextAlignTopIcon = React.memo(({ theme }: { theme: Theme }) =>
createIcon(
- ,
- { width: 448, height: 512 },
+
+
+
+
+ ,
+ tablerIconProps,
),
);
+// tabler-icons: layout-align-bottom
export const TextAlignBottomIcon = React.memo(({ theme }: { theme: Theme }) =>
createIcon(
- ,
- { width: 448, height: 512 },
+
+
+
+
+ ,
+ tablerIconProps,
),
);
+// tabler-icons: layout-align-middle
export const TextAlignMiddleIcon = React.memo(({ theme }: { theme: Theme }) =>
createIcon(
- ,
- { width: 448, height: 512 },
+
+
+
+
+
+ ,
+ tablerIconProps,
),
);
@@ -927,14 +1547,6 @@ export const publishIcon = createIcon(
{ width: 640, height: 512 },
);
-export const editIcon = createIcon(
- ,
- { width: 640, height: 512 },
-);
-
export const eraser = createIcon(
,
);
diff --git a/src/css/styles.scss b/src/css/styles.scss
index 920f7e7a..7bceb1ce 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;
- }
- }
+ padding: 0;
- .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);
- }
- }
-
- .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.scss
index 1827a74b..aaa8da5b 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,');
--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,');
--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;
- --color-primary: #5650f0;
- --color-primary-darker: #4b46d8;
- --color-primary-darkest: #3e39be;
- --color-primary-light: #3f3d64;
+ --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-danger: #ffa8a5;
+ --color-promo: #d297ff;
}
}
diff --git a/src/css/variables.module.scss b/src/css/variables.module.scss
index 4c90fd13..5a367ffe 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.tsx
index 37ed2b09..a2540383 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}
/>
)}
@@ -277,7 +277,7 @@ export const actionLink = register({
return (
updateData(null)}
diff --git a/src/element/transformHandles.ts b/src/element/transformHandles.ts
index 5821b0b4..210a2eab 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.scss
index 96dd6e16..c8bf0dcd 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.tsx
index 724856b3..d4adf977 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 = ({
{t("roomDialog.desc_intro")}
{`🔒 ${t("roomDialog.desc_privacy")}`}
- {
trackEvent("share", "room creation", `ui (${getFrame()})`);
onRoomCreate();
}}
- />
+ >
+ {start}
+
>
)}
@@ -113,6 +111,7 @@ const RoomDialog = ({
{"share" in navigator ? (
) : null}
{t("roomDialog.desc_exitSession")}
- {
trackEvent("share", "room closed");
onRoomDestroy();
}}
- />
+ >
+ {stop}
+
>
)}
diff --git a/src/excalidraw-app/components/LanguageList.tsx b/src/excalidraw-app/components/LanguageList.tsx
index 84498ea3..375bde62 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"];
-}) => (
-
-
+
+ );
+};
diff --git a/src/excalidraw-app/index.scss b/src/excalidraw-app/index.scss
index 3bd16dbc..1ea39c1b 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.tsx
index fbc78421..3f78e26b 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 = (
-
- Introducing Excalidraw+
-
-
- Try out now!
-
-
-);
+const currentLangCode = languageDetector.detect() || defaultLang.code;
-const PlusAppLinkJSX = (
-
- Go to Excalidraw+
-
+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 = () => ;
+ if (isMobile) {
return (
- {isExcalidrawPlusSignedUser ? PlusAppLinkJSX : PlusLPLinkJSX}
+
+ {t("labels.language")}
+
+
{renderLanguageList()}
);
- },
- [],
- );
+ }
- const renderFooter = useCallback(
- (isMobile: boolean) => {
- const renderEncryptedIcon = () => (
-
-
- {shield}
-
-
- );
-
- const renderLanguageList = () => (
- setLangCode(langCode)}
- languages={languages}
- currentLangCode={langCode}
- />
- );
- if (isMobile) {
- const isTinyDevice = window.innerWidth < 362;
- return (
-
+ {isExcalidrawPlusSignedUser && (
+
-
- {/* FIXME remove after 2021-05-20 */}
-
- {isExcalidrawPlusSignedUser ? PlusAppLinkJSX : PlusLPLinkJSX}
-
-
- );
- }
- return (
- <>
- {renderEncryptedIcon()}
- {renderLanguageList()}
- >
- );
- },
- [langCode],
- );
+ Go to Excalidraw+
+
+ )}
+
+
+ );
+ };
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.ts
index 266957cf..01464094 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.ts
declare namespace NodeJS {
interface ProcessEnv {
diff --git a/src/hooks/useOutsideClick.ts b/src/hooks/useOutsideClick.ts
new file mode 100644
index 00000000..bdd16c8d
--- /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.json
index c11d0bc7..f767640b 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.json
index 23afab0f..35eb7e09 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.ts
index 1265aebc..a951f66d 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.ts
index d4c6e19d..8aebcdcb 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 users
if (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.ts
index be05ddfd..a54b02b2 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 use
CSS 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.tsx
index 19718331..0eb74b9b 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 library
export const SHAPES = [
{
- icon: (
- // fa-mouse-pointer
-
- ),
+ icon: SelectionIcon,
value: "selection",
key: KEYS.V,
+ fillable: true,
},
{
- icon: (
- // fa-square
-
- ),
+ icon: RectangleIcon,
value: "rectangle",
key: KEYS.R,
+ fillable: true,
},
{
- icon: (
- // custom
-
- ),
+ icon: DiamondIcon,
value: "diamond",
key: KEYS.D,
+ fillable: true,
},
{
- icon: (
- // fa-circle
-
- ),
+ icon: EllipseIcon,
value: "ellipse",
key: KEYS.O,
+ fillable: true,
},
{
- icon: (
- // fa-long-arrow-alt-right
-
- ),
+ icon: ArrowIcon,
value: "arrow",
key: KEYS.A,
+ fillable: true,
},
{
- icon: (
- // custom
-
- ),
+ icon: LineIcon,
value: "line",
key: [KEYS.P, KEYS.L],
+ fillable: true,
},
{
- icon: (
- // fa-pencil
-
- ),
+ icon: FreedrawIcon,
value: "freedraw",
key: [KEYS.X, KEYS.P.toUpperCase()],
+ fillable: false,
},
{
- icon: (
- // fa-font
-
- ),
+ icon: TextIcon,
value: "text",
key: KEYS.T,
+ fillable: false,
},
{
- icon: (
- // fa-image
-
- ),
+ 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 === key
diff --git a/src/tests/__snapshots__/contextmenu.test.tsx.snap b/src/tests/__snapshots__/contextmenu.test.tsx.snap
index 70bada66..c16a47c3 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] numbe
exports[`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.snap
index 834015ac..68ae3178 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.ts
index 61594fc7..f3fd174b 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.tsx
index 4b3f795c..122bd135 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 midpoint
drag(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 midpoint
drag(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 sharpness
fireEvent.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 element
drag(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 point
drag(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 point
drag(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 point
deletePoint(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 point
drag(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.snap
index c2af99ea..0d8e2728 100644
--- a/src/tests/packages/__snapshots__/excalidraw.test.tsx.snap
+++ b/src/tests/packages/__snapshots__/excalidraw.test.tsx.snap
@@ -3,7 +3,6 @@
exports[` Test UIOptions prop Test canvasActions should not hide any UI element when canvasActions is "undefined" 1`] = `
Test UIOptions prop Test canvasActions should not hide an
Canvas actions
+
+
+
+
+
+
+
@@ -202,7 +171,6 @@ exports[` Test UIOptions prop Test canvasActions should not hide an
exports[` Test UIOptions prop should not hide any UI element when the UIOptions prop is "undefined" 1`] = `
Test UIOptions prop should not hide any UI element when t
Canvas actions
+
+
+
+
+
+
+
diff --git a/src/tests/packages/__snapshots__/utils.test.ts.snap b/src/tests/packages/__snapshots__/utils.test.ts.snap
index 4f1b380e..75397290 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.ts
index c3f89382..52a84ef3 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;