void;
- compactMode?: boolean;
}
const ColorPickerPopupContent = ({
@@ -100,6 +99,9 @@ const ColorPickerPopupContent = ({
getOpenPopup: () => AppState["openPopup"];
}) => {
const { container } = useExcalidrawContainer();
+ const stylesPanelMode = useStylesPanelMode();
+ const isCompactMode = stylesPanelMode !== "full";
+ const isMobileMode = stylesPanelMode === "mobile";
const [, setActiveColorPickerSection] = useAtom(activeColorPickerSectionAtom);
const [eyeDropperState, setEyeDropperState] = useAtom(activeEyeDropperAtom);
@@ -216,11 +218,8 @@ const ColorPickerPopupContent = ({
type={type}
elements={elements}
updateData={updateData}
- showTitle={
- appState.stylesPanelMode === "compact" ||
- appState.stylesPanelMode === "mobile"
- }
- showHotKey={appState.stylesPanelMode !== "mobile"}
+ showTitle={isCompactMode}
+ showHotKey={!isMobileMode}
>
{colorInputJSX}
@@ -235,7 +234,6 @@ const ColorPickerTrigger = ({
label,
color,
type,
- stylesPanelMode,
mode = "background",
onToggle,
editingTextElement,
@@ -243,11 +241,13 @@ const ColorPickerTrigger = ({
color: string | null;
label: string;
type: ColorPickerType;
- stylesPanelMode?: AppState["stylesPanelMode"];
mode?: "background" | "stroke";
onToggle: () => void;
editingTextElement?: boolean;
}) => {
+ const stylesPanelMode = useStylesPanelMode();
+ const isCompactMode = stylesPanelMode !== "full";
+ const isMobileMode = stylesPanelMode === "mobile";
const handleClick = (e: React.MouseEvent) => {
// use pointerdown so we run before outside-close logic
e.preventDefault();
@@ -268,9 +268,8 @@ const ColorPickerTrigger = ({
"is-transparent": !color || color === "transparent",
"has-outline":
!color || !isColorDark(color, COLOR_OUTLINE_CONTRAST_THRESHOLD),
- "compact-sizing":
- stylesPanelMode === "compact" || stylesPanelMode === "mobile",
- "mobile-border": stylesPanelMode === "mobile",
+ "compact-sizing": isCompactMode,
+ "mobile-border": isMobileMode,
})}
aria-label={label}
style={color ? { "--swatch-color": color } : undefined}
@@ -283,22 +282,20 @@ const ColorPickerTrigger = ({
onClick={handleClick}
>
{!color && slashIcon}
- {(stylesPanelMode === "compact" || stylesPanelMode === "mobile") &&
- color &&
- mode === "stroke" && (
-
-
- {strokeIcon}
-
-
- )}
+ {isCompactMode && color && mode === "stroke" && (
+
+
+ {strokeIcon}
+
+
+ )}
);
};
@@ -318,9 +315,8 @@ export const ColorPicker = ({
useEffect(() => {
openRef.current = appState.openPopup;
}, [appState.openPopup]);
- const compactMode =
- appState.stylesPanelMode === "compact" ||
- appState.stylesPanelMode === "mobile";
+ const stylesPanelMode = useStylesPanelMode();
+ const isCompactMode = stylesPanelMode !== "full";
return (
@@ -328,10 +324,10 @@ export const ColorPicker = ({
role="dialog"
aria-modal="true"
className={clsx("color-picker-container", {
- "color-picker-container--no-top-picks": compactMode,
+ "color-picker-container--no-top-picks": isCompactMode,
})}
>
- {!compactMode && (
+ {!isCompactMode && (
)}
- {!compactMode &&
}
+ {!isCompactMode &&
}
{
@@ -353,7 +349,6 @@ export const ColorPicker = ({
color={color}
label={label}
type={type}
- stylesPanelMode={appState.stylesPanelMode}
mode={type === "elementStroke" ? "stroke" : "background"}
editingTextElement={!!appState.editingTextElement}
onToggle={() => {
diff --git a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
index 03f9c93cb8..4c8a8aeb72 100644
--- a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
+++ b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
@@ -899,7 +899,7 @@ function CommandPaletteInner({
ref={inputRef}
/>
- {!app.device.viewport.isMobile && (
+ {app.editorInterface.formFactor !== "phone" && (
{t("commandPalette.shortcuts.select")}
@@ -933,7 +933,7 @@ function CommandPaletteInner({
onClick={(event) => executeCommand(lastUsed, event)}
disabled={!isCommandAvailable(lastUsed)}
onMouseMove={() => setCurrentCommand(lastUsed)}
- showShortcut={!app.device.viewport.isMobile}
+ showShortcut={app.editorInterface.formFactor !== "phone"}
appState={uiAppState}
/>
@@ -951,7 +951,7 @@ function CommandPaletteInner({
isSelected={command.label === currentCommand?.label}
onClick={(event) => executeCommand(command, event)}
onMouseMove={() => setCurrentCommand(command)}
- showShortcut={!app.device.viewport.isMobile}
+ showShortcut={app.editorInterface.formFactor !== "phone"}
appState={uiAppState}
size={category === "Library" ? "large" : "small"}
/>
diff --git a/packages/excalidraw/components/Dialog.tsx b/packages/excalidraw/components/Dialog.tsx
index 00ae2be0cb..55109d07f3 100644
--- a/packages/excalidraw/components/Dialog.tsx
+++ b/packages/excalidraw/components/Dialog.tsx
@@ -9,7 +9,7 @@ import { t } from "../i18n";
import {
useExcalidrawContainer,
- useDevice,
+ useEditorInterface,
useExcalidrawSetAppState,
} from "./App";
import { Island } from "./Island";
@@ -51,7 +51,7 @@ export const Dialog = (props: DialogProps) => {
const [islandNode, setIslandNode] = useCallbackRefState();
const [lastActiveElement] = useState(document.activeElement);
const { id } = useExcalidrawContainer();
- const isFullscreen = useDevice().viewport.isMobile;
+ const isFullscreen = useEditorInterface().formFactor === "phone";
useEffect(() => {
if (!islandNode) {
diff --git a/packages/excalidraw/components/FontPicker/FontPickerList.tsx b/packages/excalidraw/components/FontPicker/FontPickerList.tsx
index ff59f05ece..a6202f0227 100644
--- a/packages/excalidraw/components/FontPicker/FontPickerList.tsx
+++ b/packages/excalidraw/components/FontPicker/FontPickerList.tsx
@@ -20,7 +20,12 @@ import type { ValueOf } from "@excalidraw/common/utility-types";
import { Fonts } from "../../fonts";
import { t } from "../../i18n";
-import { useApp, useAppProps, useExcalidrawContainer } from "../App";
+import {
+ useApp,
+ useAppProps,
+ useExcalidrawContainer,
+ useStylesPanelMode,
+} from "../App";
import { PropertiesPopover } from "../PropertiesPopover";
import { QuickSearch } from "../QuickSearch";
import { ScrollableList } from "../ScrollableList";
@@ -93,6 +98,7 @@ export const FontPickerList = React.memo(
const app = useApp();
const { fonts } = app;
const { showDeprecatedFonts } = useAppProps();
+ const stylesPanelMode = useStylesPanelMode();
const [searchTerm, setSearchTerm] = useState("");
const inputRef = useRef(null);
@@ -338,7 +344,7 @@ export const FontPickerList = React.memo(
onKeyDown={onKeyDown}
preventAutoFocusOnTouch={!!app.state.editingTextElement}
>
- {app.state.stylesPanelMode === "full" && (
+ {stylesPanelMode === "full" && (
{
const { activeTool, isResizing, isRotating, lastPointerDownWith } = appState;
@@ -45,7 +45,7 @@ const getHints = ({
return t("hints.dismissSearch");
}
- if (appState.openSidebar && !device.editor.canFitSidebar) {
+ if (appState.openSidebar && !editorInterface.canFitSidebar) {
return null;
}
@@ -168,13 +168,13 @@ const getHints = ({
export const HintViewer = ({
appState,
isMobile,
- device,
+ editorInterface,
app,
}: HintViewerProps) => {
const hints = getHints({
appState,
isMobile,
- device,
+ editorInterface,
app,
});
diff --git a/packages/excalidraw/components/IconPicker.tsx b/packages/excalidraw/components/IconPicker.tsx
index 2d7f8a0ba5..815465e6ab 100644
--- a/packages/excalidraw/components/IconPicker.tsx
+++ b/packages/excalidraw/components/IconPicker.tsx
@@ -8,7 +8,7 @@ import { atom, useAtom } from "../editor-jotai";
import { getLanguage, t } from "../i18n";
import Collapsible from "./Stats/Collapsible";
-import { useDevice } from "./App";
+import { useEditorInterface } from "./App";
import "./IconPicker.scss";
@@ -38,7 +38,7 @@ function Picker({
onClose: () => void;
numberOfOptionsToAlwaysShow?: number;
}) {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const handleKeyDown = (event: React.KeyboardEvent) => {
const pressedOption = options.find(
@@ -152,7 +152,7 @@ function Picker({
);
};
- const isMobile = device.editor.isMobile;
+ const isMobile = editorInterface.formFactor === "phone";
return (
{
- const device = useDevice();
+ const editorInterface = useEditorInterface();
+ const stylesPanelMode = useStylesPanelMode();
+ const isCompactStylesPanel = stylesPanelMode === "compact";
const tunnels = useInitializeTunnels();
- const spacing =
- appState.stylesPanelMode === "compact"
- ? {
- menuTopGap: 4,
- toolbarColGap: 4,
- toolbarRowGap: 1,
- toolbarInnerRowGap: 0.5,
- islandPadding: 1,
- collabMarginLeft: 8,
- }
- : {
- menuTopGap: 6,
- toolbarColGap: 4,
- toolbarRowGap: 1,
- toolbarInnerRowGap: 1,
- islandPadding: 1,
- collabMarginLeft: 8,
- };
+ const spacing = isCompactStylesPanel
+ ? {
+ menuTopGap: 4,
+ toolbarColGap: 4,
+ toolbarRowGap: 1,
+ toolbarInnerRowGap: 0.5,
+ islandPadding: 1,
+ collabMarginLeft: 8,
+ }
+ : {
+ menuTopGap: 6,
+ toolbarColGap: 4,
+ toolbarRowGap: 1,
+ toolbarInnerRowGap: 1,
+ islandPadding: 1,
+ collabMarginLeft: 8,
+ };
const TunnelsJotaiProvider = tunnels.tunnelsJotai.Provider;
@@ -236,7 +237,7 @@ const LayerUI = ({
);
const renderSelectedShapeActions = () => {
- const isCompactMode = appState.stylesPanelMode === "compact";
+ const isCompactMode = isCompactStylesPanel;
return (
{shouldRenderSelectedShapeActions && renderSelectedShapeActions()}
@@ -333,14 +334,13 @@ const LayerUI = ({
padding={spacing.islandPadding}
className={clsx("App-toolbar", {
"zen-mode": appState.zenModeEnabled,
- "App-toolbar--compact":
- appState.stylesPanelMode === "compact",
+ "App-toolbar--compact": isCompactStylesPanel,
})}
>
{heading}
@@ -406,8 +406,7 @@ const LayerUI = ({
"layer-ui__wrapper__top-right zen-mode-transition",
{
"transition-right": appState.zenModeEnabled,
- "layer-ui__wrapper__top-right--compact":
- appState.stylesPanelMode === "compact",
+ "layer-ui__wrapper__top-right--compact": isCompactStylesPanel,
},
)}
>
@@ -417,7 +416,10 @@ const LayerUI = ({
userToFollow={appState.userToFollow?.socketId || null}
/>
)}
- {renderTopRightUI?.(device.editor.isMobile, appState)}
+ {renderTopRightUI?.(
+ editorInterface.formFactor === "phone",
+ appState,
+ )}
{!appState.viewModeEnabled &&
appState.openDialog?.name !== "elementLinkSelector" &&
// hide button when sidebar docked
@@ -448,7 +450,9 @@ const LayerUI = ({
trackEvent(
"sidebar",
`toggleDock (${docked ? "dock" : "undock"})`,
- `(${device.editor.isMobile ? "mobile" : "desktop"})`,
+ `(${
+ editorInterface.formFactor === "phone" ? "mobile" : "desktop"
+ })`,
);
}}
/>
@@ -476,13 +480,15 @@ const LayerUI = ({
trackEvent(
"sidebar",
`${DEFAULT_SIDEBAR.name} (open)`,
- `button (${device.editor.isMobile ? "mobile" : "desktop"})`,
+ `button (${
+ editorInterface.formFactor === "phone" ? "mobile" : "desktop"
+ })`,
);
}
}}
tab={DEFAULT_SIDEBAR.defaultTab}
>
- {appState.stylesPanelMode === "full" &&
+ {stylesPanelMode === "full" &&
appState.width >= MQ_MIN_WIDTH_DESKTOP &&
t("toolBar.library")}
@@ -496,7 +502,7 @@ const LayerUI = ({
{appState.errorMessage}
)}
- {eyeDropperState && !device.editor.isMobile && (
+ {eyeDropperState && editorInterface.formFactor !== "phone" && (
{
@@ -575,7 +581,7 @@ const LayerUI = ({
}
/>
)}
- {device.editor.isMobile && (
+ {editorInterface.formFactor === "phone" && (
)}
- {!device.editor.isMobile && (
+ {editorInterface.formFactor !== "phone" && (
<>
void;
}) {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const libraryContainerRef = useRef
(null);
const scrollPosition = useScrollPosition(libraryContainerRef);
@@ -392,7 +392,7 @@ export default function LibraryMenuItems({
ref={searchInputRef}
type="search"
className={clsx("library-menu-items-container__search", {
- hideCancelButton: !device.editor.isMobile,
+ hideCancelButton: editorInterface.formFactor !== "phone",
})}
placeholder={t("library.search.inputPlaceholder")}
value={searchInputValue}
diff --git a/packages/excalidraw/components/LibraryUnit.tsx b/packages/excalidraw/components/LibraryUnit.tsx
index 36607910e5..7d6a599526 100644
--- a/packages/excalidraw/components/LibraryUnit.tsx
+++ b/packages/excalidraw/components/LibraryUnit.tsx
@@ -3,7 +3,7 @@ import { memo, useRef, useState } from "react";
import { useLibraryItemSvg } from "../hooks/useLibraryItemSvg";
-import { useDevice } from "./App";
+import { useEditorInterface } from "./App";
import { CheckboxItem } from "./CheckboxItem";
import { PlusIcon } from "./icons";
@@ -36,7 +36,7 @@ export const LibraryUnit = memo(
const svg = useLibraryItemSvg(id, elements, svgCache, ref);
const [isHovered, setIsHovered] = useState(false);
- const isMobile = useDevice().editor.isMobile;
+ const isMobile = useEditorInterface().formFactor === "phone";
const adder = isPending && (
{PlusIcon}
);
diff --git a/packages/excalidraw/components/PropertiesPopover.tsx b/packages/excalidraw/components/PropertiesPopover.tsx
index d4437b3858..2970258a58 100644
--- a/packages/excalidraw/components/PropertiesPopover.tsx
+++ b/packages/excalidraw/components/PropertiesPopover.tsx
@@ -4,7 +4,7 @@ import React, { type ReactNode } from "react";
import { isInteractive } from "@excalidraw/common";
-import { useDevice } from "./App";
+import { useEditorInterface } from "./App";
import { Island } from "./Island";
interface PropertiesPopoverProps {
@@ -39,7 +39,7 @@ export const PropertiesPopover = React.forwardRef<
},
ref,
) => {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
return (
@@ -48,12 +48,14 @@ export const PropertiesPopover = React.forwardRef<
className={clsx("focus-visible-none", className)}
data-prevent-outside-click
side={
- device.editor.isMobile && !device.viewport.isLandscape
+ editorInterface.formFactor === "phone" &&
+ !editorInterface.isLandscape
? "bottom"
: "right"
}
align={
- device.editor.isMobile && !device.viewport.isLandscape
+ editorInterface.formFactor === "phone" &&
+ !editorInterface.isLandscape
? "center"
: "start"
}
@@ -68,7 +70,7 @@ export const PropertiesPopover = React.forwardRef<
onPointerDownOutside={onPointerDownOutside}
onOpenAutoFocus={(e) => {
// prevent auto-focus on touch devices to avoid keyboard popup
- if (preventAutoFocusOnTouch && device.isTouchScreen) {
+ if (preventAutoFocusOnTouch && editorInterface.isTouchScreen) {
e.preventDefault();
}
}}
diff --git a/packages/excalidraw/components/Sidebar/Sidebar.tsx b/packages/excalidraw/components/Sidebar/Sidebar.tsx
index 5f0ca487f2..8226eacef5 100644
--- a/packages/excalidraw/components/Sidebar/Sidebar.tsx
+++ b/packages/excalidraw/components/Sidebar/Sidebar.tsx
@@ -20,7 +20,7 @@ import {
import { useUIAppState } from "../../context/ui-appState";
import { atom, useSetAtom } from "../../editor-jotai";
import { useOutsideClick } from "../../hooks/useOutsideClick";
-import { useDevice, useExcalidrawSetAppState } from "../App";
+import { useEditorInterface, useExcalidrawSetAppState } from "../App";
import { Island } from "../Island";
import { SidebarHeader } from "./SidebarHeader";
@@ -96,7 +96,7 @@ export const SidebarInner = forwardRef(
return islandRef.current!;
});
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const closeLibrary = useCallback(() => {
const isDialogOpen = !!document.querySelector(".Dialog");
@@ -117,11 +117,11 @@ export const SidebarInner = forwardRef(
if ((event.target as Element).closest(".sidebar-trigger")) {
return;
}
- if (!docked || !device.editor.canFitSidebar) {
+ if (!docked || !editorInterface.canFitSidebar) {
closeLibrary();
}
},
- [closeLibrary, docked, device.editor.canFitSidebar],
+ [closeLibrary, docked, editorInterface.canFitSidebar],
),
);
@@ -129,7 +129,7 @@ export const SidebarInner = forwardRef(
const handleKeyDown = (event: KeyboardEvent) => {
if (
event.key === KEYS.ESCAPE &&
- (!docked || !device.editor.canFitSidebar)
+ (!docked || !editorInterface.canFitSidebar)
) {
closeLibrary();
}
@@ -138,7 +138,7 @@ export const SidebarInner = forwardRef(
return () => {
document.removeEventListener(EVENT.KEYDOWN, handleKeyDown);
};
- }, [closeLibrary, docked, device.editor.canFitSidebar]);
+ }, [closeLibrary, docked, editorInterface.canFitSidebar]);
return (
{
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const props = useContext(SidebarPropsContext);
const renderDockButton = !!(
- device.editor.canFitSidebar && props.shouldRenderDockButton
+ editorInterface.canFitSidebar && props.shouldRenderDockButton
);
return (
diff --git a/packages/excalidraw/components/canvases/InteractiveCanvas.tsx b/packages/excalidraw/components/canvases/InteractiveCanvas.tsx
index c375a2b168..1f7a37a454 100644
--- a/packages/excalidraw/components/canvases/InteractiveCanvas.tsx
+++ b/packages/excalidraw/components/canvases/InteractiveCanvas.tsx
@@ -20,7 +20,11 @@ import type {
RenderableElementsMap,
RenderInteractiveSceneCallback,
} from "../../scene/types";
-import type { AppState, Device, InteractiveCanvasAppState } from "../../types";
+import type {
+ AppState,
+ EditorInterface,
+ InteractiveCanvasAppState,
+} from "../../types";
import type { DOMAttributes } from "react";
type InteractiveCanvasProps = {
@@ -35,7 +39,7 @@ type InteractiveCanvasProps = {
scale: number;
appState: InteractiveCanvasAppState;
renderScrollbars: boolean;
- device: Device;
+ editorInterface: EditorInterface;
renderInteractiveSceneCallback: (
data: RenderInteractiveSceneCallback,
) => void;
@@ -146,7 +150,7 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
selectionColor,
renderScrollbars: props.renderScrollbars,
},
- device: props.device,
+ editorInterface: props.editorInterface,
callback: props.renderInteractiveSceneCallback,
},
isRenderThrottlingEnabled(),
diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx
index 291f857e80..28f7c78fc0 100644
--- a/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx
+++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx
@@ -5,7 +5,7 @@ import { EVENT, KEYS } from "@excalidraw/common";
import { useOutsideClick } from "../../hooks/useOutsideClick";
import { useStable } from "../../hooks/useStable";
-import { useDevice } from "../App";
+import { useEditorInterface } from "../App";
import { Island } from "../Island";
import Stack from "../Stack";
@@ -29,7 +29,7 @@ const MenuContent = ({
style?: React.CSSProperties;
placement?: "top" | "bottom";
}) => {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const menuRef = useRef(null);
const callbacksRef = useStable({ onClickOutside });
@@ -59,7 +59,7 @@ const MenuContent = ({
}, [callbacksRef]);
const classNames = clsx(`dropdown-menu ${className}`, {
- "dropdown-menu--mobile": device.editor.isMobile,
+ "dropdown-menu--mobile": editorInterface.formFactor === "phone",
"dropdown-menu--placement-top": placement === "top",
}).trim();
@@ -73,7 +73,7 @@ const MenuContent = ({
>
{/* the zIndex ensures this menu has higher stacking order,
see https://github.com/excalidraw/excalidraw/pull/1445 */}
- {device.editor.isMobile ? (
+ {editorInterface.formFactor === "phone" ? (
{children}
) : (
{
- const device = useDevice();
+ const editorInterface = useEditorInterface();
return (
<>
{icon && {icon}
}
{children}
- {shortcut && !device.editor.isMobile && (
+ {shortcut && editorInterface.formFactor !== "phone" && (
{shortcut}
)}
>
diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx
index 14bfe1a904..d8177c50e0 100644
--- a/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx
+++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx
@@ -1,4 +1,4 @@
-import { useDevice } from "../App";
+import { useEditorInterface } from "../App";
import { RadioGroup } from "../RadioGroup";
type Props = {
@@ -22,7 +22,7 @@ const DropdownMenuItemContentRadio = ({
children,
name,
}: Props) => {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
return (
<>
@@ -37,7 +37,7 @@ const DropdownMenuItemContentRadio = ({
choices={choices}
/>
- {shortcut && !device.editor.isMobile && (
+ {shortcut && editorInterface.formFactor !== "phone" && (
{shortcut}
diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.tsx
index a7301fb447..f43e4493b1 100644
--- a/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.tsx
+++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.tsx
@@ -1,6 +1,6 @@
import clsx from "clsx";
-import { useDevice } from "../App";
+import { useEditorInterface } from "../App";
const MenuTrigger = ({
className = "",
@@ -14,12 +14,12 @@ const MenuTrigger = ({
onToggle: () => void;
title?: string;
} & Omit, "onSelect">) => {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const classNames = clsx(
`dropdown-menu-button ${className}`,
"zen-mode-transition",
{
- "dropdown-menu-button--mobile": device.editor.isMobile,
+ "dropdown-menu-button--mobile": editorInterface.formFactor === "phone",
},
).trim();
return (
diff --git a/packages/excalidraw/components/hyperlink/Hyperlink.tsx b/packages/excalidraw/components/hyperlink/Hyperlink.tsx
index 5e380e4e6e..8e15bb0d54 100644
--- a/packages/excalidraw/components/hyperlink/Hyperlink.tsx
+++ b/packages/excalidraw/components/hyperlink/Hyperlink.tsx
@@ -41,7 +41,7 @@ import { getTooltipDiv, updateTooltipPosition } from "../../components/Tooltip";
import { t } from "../../i18n";
-import { useAppProps, useDevice, useExcalidrawAppState } from "../App";
+import { useAppProps, useEditorInterface, useExcalidrawAppState } from "../App";
import { ToolButton } from "../ToolButton";
import { FreedrawIcon, TrashIcon, elementLinkIcon } from "../icons";
import { getSelectedElements } from "../../scene";
@@ -88,7 +88,7 @@ export const Hyperlink = ({
const elementsMap = scene.getNonDeletedElementsMap();
const appState = useExcalidrawAppState();
const appProps = useAppProps();
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const linkVal = element.link || "";
@@ -189,11 +189,11 @@ export const Hyperlink = ({
if (
isEditing &&
inputRef?.current &&
- !(device.viewport.isMobile || device.isTouchScreen)
+ !(editorInterface.formFactor === "phone" || editorInterface.isTouchScreen)
) {
inputRef.current.select();
}
- }, [isEditing, device.viewport.isMobile, device.isTouchScreen]);
+ }, [isEditing, editorInterface.formFactor, editorInterface.isTouchScreen]);
useEffect(() => {
let timeoutId: number | null = null;
diff --git a/packages/excalidraw/components/main-menu/MainMenu.tsx b/packages/excalidraw/components/main-menu/MainMenu.tsx
index 8ce2a5d69b..7249ab94df 100644
--- a/packages/excalidraw/components/main-menu/MainMenu.tsx
+++ b/packages/excalidraw/components/main-menu/MainMenu.tsx
@@ -5,7 +5,7 @@ import { composeEventHandlers } from "@excalidraw/common";
import { useTunnels } from "../../context/tunnels";
import { useUIAppState } from "../../context/ui-appState";
import { t } from "../../i18n";
-import { useDevice, useExcalidrawSetAppState } from "../App";
+import { useEditorInterface, useExcalidrawSetAppState } from "../App";
import { UserList } from "../UserList";
import DropdownMenu from "../dropdownMenu/DropdownMenu";
import { withInternalFallback } from "../hoc/withInternalFallback";
@@ -27,12 +27,13 @@ const MainMenu = Object.assign(
onSelect?: (event: Event) => void;
}) => {
const { MainMenuTunnel } = useTunnels();
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const appState = useUIAppState();
const setAppState = useExcalidrawSetAppState();
- const onClickOutside = device.editor.isMobile
- ? undefined
- : () => setAppState({ openMenu: null });
+ const onClickOutside =
+ editorInterface.formFactor === "phone"
+ ? undefined
+ : () => setAppState({ openMenu: null });
return (
@@ -54,19 +55,24 @@ const MainMenu = Object.assign(
setAppState({ openMenu: null });
})}
placement="bottom"
- className={device.editor.isMobile ? "main-menu-dropdown" : ""}
+ className={
+ editorInterface.formFactor === "phone"
+ ? "main-menu-dropdown"
+ : ""
+ }
>
{children}
- {device.editor.isMobile && appState.collaborators.size > 0 && (
-
- {t("labels.collaborators")}
-
-
- )}
+ {editorInterface.formFactor === "phone" &&
+ appState.collaborators.size > 0 && (
+
+ {t("labels.collaborators")}
+
+
+ )}
diff --git a/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx b/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx
index 8f548823e9..823384abbc 100644
--- a/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx
+++ b/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx
@@ -3,7 +3,7 @@ import { getShortcutFromShortcutName } from "../../actions/shortcuts";
import { useTunnels } from "../../context/tunnels";
import { useUIAppState } from "../../context/ui-appState";
import { t, useI18n } from "../../i18n";
-import { useDevice, useExcalidrawActionManager } from "../App";
+import { useEditorInterface, useExcalidrawActionManager } from "../App";
import { ExcalidrawLogo } from "../ExcalidrawLogo";
import { HelpIcon, LoadIcon, usersIcon } from "../icons";
@@ -18,12 +18,12 @@ const WelcomeScreenMenuItemContent = ({
shortcut?: string | null;
children: React.ReactNode;
}) => {
- const device = useDevice();
+ const editorInterface = useEditorInterface();
return (
<>
{icon}
{children}
- {shortcut && !device.editor.isMobile && (
+ {shortcut && editorInterface.formFactor !== "phone" && (
{shortcut}
)}
>
diff --git a/packages/excalidraw/editorInterface.ts b/packages/excalidraw/editorInterface.ts
new file mode 100644
index 0000000000..9e0a659daa
--- /dev/null
+++ b/packages/excalidraw/editorInterface.ts
@@ -0,0 +1,59 @@
+import { isAndroid, isIOS, isMobileOrTablet } from "@excalidraw/common";
+
+import type { EditorInterface, StylesPanelMode } from "./types";
+
+export const DESKTOP_UI_MODE_STORAGE_KEY = "excalidraw.desktopUIMode";
+
+export const deriveFormFactor = (
+ editorWidth: number,
+ editorHeight: number,
+ breakpoints: {
+ isMobile: (width: number, height: number) => boolean;
+ isTablet: (width: number, height: number) => boolean;
+ },
+): EditorInterface["formFactor"] => {
+ if (breakpoints.isMobile(editorWidth, editorHeight)) {
+ return "phone";
+ }
+
+ if (breakpoints.isTablet(editorWidth, editorHeight)) {
+ return "tablet";
+ }
+
+ return "desktop";
+};
+
+export const deriveStylesPanelMode = (
+ editorInterface: EditorInterface,
+): StylesPanelMode => {
+ if (editorInterface.formFactor === "phone") {
+ return "mobile";
+ }
+
+ if (editorInterface.formFactor === "tablet") {
+ return "compact";
+ }
+
+ return editorInterface.desktopUIMode;
+};
+
+export const createUserAgentDescriptor = (
+ userAgentString: string,
+): EditorInterface["userAgent"] => {
+ const normalizedUA = userAgentString ?? "";
+ let platform: EditorInterface["userAgent"]["platform"] = "unknown";
+
+ if (isIOS) {
+ platform = "ios";
+ } else if (isAndroid) {
+ platform = "android";
+ } else if (normalizedUA) {
+ platform = "other";
+ }
+
+ return {
+ raw: normalizedUA,
+ isMobileDevice: isMobileOrTablet(),
+ platform,
+ } as const;
+};
diff --git a/packages/excalidraw/hooks/useCreatePortalContainer.ts b/packages/excalidraw/hooks/useCreatePortalContainer.ts
index fb0d24bc3d..c1fe2c9e8f 100644
--- a/packages/excalidraw/hooks/useCreatePortalContainer.ts
+++ b/packages/excalidraw/hooks/useCreatePortalContainer.ts
@@ -2,7 +2,7 @@ import { useState, useLayoutEffect } from "react";
import { THEME } from "@excalidraw/common";
-import { useDevice, useExcalidrawContainer } from "../components/App";
+import { useEditorInterface, useExcalidrawContainer } from "../components/App";
import { useUIAppState } from "../context/ui-appState";
export const useCreatePortalContainer = (opts?: {
@@ -11,7 +11,7 @@ export const useCreatePortalContainer = (opts?: {
}) => {
const [div, setDiv] = useState(null);
- const device = useDevice();
+ const editorInterface = useEditorInterface();
const { theme } = useUIAppState();
const { container: excalidrawContainer } = useExcalidrawContainer();
@@ -20,10 +20,13 @@ export const useCreatePortalContainer = (opts?: {
if (div) {
div.className = "";
div.classList.add("excalidraw", ...(opts?.className?.split(/\s+/) || []));
- div.classList.toggle("excalidraw--mobile", device.editor.isMobile);
+ div.classList.toggle(
+ "excalidraw--mobile",
+ editorInterface.formFactor === "phone",
+ );
div.classList.toggle("theme--dark", theme === THEME.DARK);
}
- }, [div, theme, device.editor.isMobile, opts?.className]);
+ }, [div, theme, editorInterface.formFactor, opts?.className]);
useLayoutEffect(() => {
const container = opts?.parentSelector
diff --git a/packages/excalidraw/index.tsx b/packages/excalidraw/index.tsx
index 1d599a98ec..02722bea98 100644
--- a/packages/excalidraw/index.tsx
+++ b/packages/excalidraw/index.tsx
@@ -285,7 +285,7 @@ export { Button } from "./components/Button";
export { Footer };
export { MainMenu };
export { Ellipsify } from "./components/Ellipsify";
-export { useDevice } from "./components/App";
+export { useEditorInterface, useStylesPanelMode } from "./components/App";
export { WelcomeScreen };
export { LiveCollaborationTrigger };
export { Stats } from "./components/Stats";
diff --git a/packages/excalidraw/renderer/interactiveScene.ts b/packages/excalidraw/renderer/interactiveScene.ts
index e071d47aaf..89edf248f3 100644
--- a/packages/excalidraw/renderer/interactiveScene.ts
+++ b/packages/excalidraw/renderer/interactiveScene.ts
@@ -19,7 +19,7 @@ import {
import { FIXED_BINDING_DISTANCE, maxBindingGap } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element";
import {
- getOmitSidesForDevice,
+ getOmitSidesForEditorInterface,
getTransformHandles,
getTransformHandlesFromCoords,
shouldShowBoundingBox,
@@ -734,7 +734,7 @@ const _renderInteractiveScene = ({
scale,
appState,
renderConfig,
- device,
+ editorInterface,
}: InteractiveSceneRenderConfig) => {
if (canvas === null) {
return { atLeastOneVisibleElement: false, elementsMap };
@@ -1024,7 +1024,7 @@ const _renderInteractiveScene = ({
appState.zoom,
elementsMap,
"mouse", // when we render we don't know which pointer type so use mouse,
- getOmitSidesForDevice(device),
+ getOmitSidesForEditorInterface(editorInterface),
);
if (
!appState.viewModeEnabled &&
@@ -1088,8 +1088,11 @@ const _renderInteractiveScene = ({
appState.zoom,
"mouse",
isFrameSelected
- ? { ...getOmitSidesForDevice(device), rotation: true }
- : getOmitSidesForDevice(device),
+ ? {
+ ...getOmitSidesForEditorInterface(editorInterface),
+ rotation: true,
+ }
+ : getOmitSidesForEditorInterface(editorInterface),
);
if (selectedElements.some((element) => !element.locked)) {
renderTransformHandles(
diff --git a/packages/excalidraw/scene/types.ts b/packages/excalidraw/scene/types.ts
index 12a5e27a8e..999d2c7bef 100644
--- a/packages/excalidraw/scene/types.ts
+++ b/packages/excalidraw/scene/types.ts
@@ -16,7 +16,7 @@ import type {
InteractiveCanvasAppState,
StaticCanvasAppState,
SocketId,
- Device,
+ EditorInterface,
PendingExcalidrawElements,
} from "../types";
import type { RoughCanvas } from "roughjs/bin/canvas";
@@ -97,7 +97,7 @@ export type InteractiveSceneRenderConfig = {
scale: number;
appState: InteractiveCanvasAppState;
renderConfig: InteractiveCanvasRenderConfig;
- device: Device;
+ editorInterface: EditorInterface;
callback: (data: RenderInteractiveSceneCallback) => void;
};
diff --git a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap
index 6f4f6fd559..e4ef367a8a 100644
--- a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap
@@ -985,7 +985,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1181,7 +1180,6 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": {
@@ -1398,7 +1396,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1732,7 +1729,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2066,7 +2062,6 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": {
@@ -2281,7 +2276,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2527,7 +2521,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2833,7 +2826,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3203,7 +3195,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": {
@@ -3699,7 +3690,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4025,7 +4015,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4354,7 +4343,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5642,7 +5630,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -6864,7 +6851,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7798,7 +7784,6 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8800,7 +8785,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9797,7 +9781,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
diff --git a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
index d436af1375..37037e7822 100644
--- a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
@@ -104,7 +104,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -723,7 +722,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1211,7 +1209,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1578,7 +1575,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1948,7 +1944,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2213,7 +2208,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2659,7 +2653,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2965,7 +2958,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3287,7 +3279,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3584,7 +3575,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3873,7 +3863,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4111,7 +4100,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4371,7 +4359,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4645,7 +4632,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4877,7 +4863,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5109,7 +5094,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5359,7 +5343,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5618,7 +5601,6 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5878,7 +5860,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -6210,7 +6191,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -6643,7 +6623,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7026,7 +7005,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7330,7 +7308,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7649,7 +7626,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7882,7 +7858,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8237,7 +8212,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8598,7 +8572,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9001,7 +8974,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9293,7 +9265,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9560,7 +9531,6 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9828,7 +9798,6 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10064,7 +10033,6 @@ exports[`history > multiplayer undo/redo > should override remotely added groups
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10363,7 +10331,6 @@ exports[`history > multiplayer undo/redo > should override remotely added points
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10713,7 +10680,6 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10955,7 +10921,6 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11405,7 +11370,6 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11666,7 +11630,6 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11906,7 +11869,6 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12144,7 +12106,6 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12555,7 +12516,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12765,7 +12725,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12979,7 +12938,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -13280,7 +13238,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -13581,7 +13538,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on s
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -13828,7 +13784,6 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14068,7 +14023,6 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14308,7 +14262,6 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14558,7 +14511,6 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14893,7 +14845,6 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15068,7 +15019,6 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15353,7 +15303,6 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15619,7 +15568,6 @@ exports[`history > singleplayer undo/redo > should not modify anything on unrela
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15776,7 +15724,6 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -16060,7 +16007,6 @@ exports[`history > singleplayer undo/redo > should support appstate name or view
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -16226,7 +16172,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -16934,7 +16879,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -17572,7 +17516,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -18208,7 +18151,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -18933,7 +18875,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -19687,7 +19628,6 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -20172,7 +20112,6 @@ exports[`history > singleplayer undo/redo > should support duplication of groups
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -20681,7 +20620,6 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -21145,7 +21083,6 @@ exports[`history > singleplayer undo/redo > should support linear element creati
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
diff --git a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap
index a33ca9c963..2bacaaa735 100644
--- a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap
@@ -112,7 +112,6 @@ exports[`given element A and group of elements B and given both are selected whe
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -543,7 +542,6 @@ exports[`given element A and group of elements B and given both are selected whe
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -953,7 +951,6 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1522,7 +1519,6 @@ exports[`regression tests > Drags selected element when hitting only bounding bo
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -1737,7 +1733,6 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2121,7 +2116,6 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2367,7 +2361,6 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = `
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2552,7 +2545,6 @@ exports[`regression tests > can drag element that covers another element, while
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -2878,7 +2870,6 @@ exports[`regression tests > change the properties of a shape > [end of test] app
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3138,7 +3129,6 @@ exports[`regression tests > click on an element and drag it > [dragged] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3382,7 +3372,6 @@ exports[`regression tests > click on an element and drag it > [end of test] appS
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3621,7 +3610,6 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`]
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -3883,7 +3871,6 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4199,7 +4186,6 @@ exports[`regression tests > deleting last but one element in editing group shoul
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4665,7 +4651,6 @@ exports[`regression tests > deselects group of selected elements on pointer down
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -4923,7 +4908,6 @@ exports[`regression tests > deselects group of selected elements on pointer up w
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5229,7 +5213,6 @@ exports[`regression tests > deselects selected element on pointer down when poin
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5412,7 +5395,6 @@ exports[`regression tests > deselects selected element, on pointer up, when clic
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -5615,7 +5597,6 @@ exports[`regression tests > double click to edit a group > [end of test] appStat
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -6015,7 +5996,6 @@ exports[`regression tests > drags selected elements from point inside common bou
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -6309,7 +6289,6 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7173,7 +7152,6 @@ exports[`regression tests > given a group of selected elements with an element t
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7510,7 +7488,6 @@ exports[`regression tests > given a selected element A and a not selected elemen
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -7791,7 +7768,6 @@ exports[`regression tests > given selected element A with lower z-index than uns
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8029,7 +8005,6 @@ exports[`regression tests > given selected element A with lower z-index than uns
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8270,7 +8245,6 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8453,7 +8427,6 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8636,7 +8609,6 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -8846,7 +8818,6 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9079,7 +9050,6 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9281,7 +9251,6 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9509,7 +9478,6 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9715,7 +9683,6 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -9925,7 +9892,6 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10129,7 +10095,6 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10310,7 +10275,6 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10511,7 +10475,6 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -10702,7 +10665,6 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11230,7 +11192,6 @@ exports[`regression tests > noop interaction after undo shouldn't create history
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11509,7 +11470,6 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11637,7 +11597,6 @@ exports[`regression tests > shift click on selected element should deselect it o
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -11844,7 +11803,6 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12168,7 +12126,6 @@ exports[`regression tests > should group elements and ungroup them > [end of tes
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -12604,7 +12561,6 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -13238,7 +13194,6 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -13368,7 +13323,6 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`]
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14031,7 +13985,6 @@ exports[`regression tests > switches from group of selected elements to another
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14372,7 +14325,6 @@ exports[`regression tests > switches selected element on pointer down > [end of
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14607,7 +14559,6 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -14735,7 +14686,6 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15128,7 +15078,6 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
@@ -15257,7 +15206,6 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = `
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,
diff --git a/packages/excalidraw/tests/test-utils.ts b/packages/excalidraw/tests/test-utils.ts
index 78e11d1821..6c77e10a0b 100644
--- a/packages/excalidraw/tests/test-utils.ts
+++ b/packages/excalidraw/tests/test-utils.ts
@@ -192,9 +192,7 @@ export const withExcalidrawDimensions = async (
mockBoundingClientRect(dimensions);
act(() => {
// @ts-ignore
- h.app.refreshViewportBreakpoints();
- // @ts-ignore
- h.app.refreshEditorBreakpoints();
+ h.app.refreshEditorInterface();
window.h.app.refresh();
});
@@ -203,9 +201,7 @@ export const withExcalidrawDimensions = async (
restoreOriginalGetBoundingClientRect();
act(() => {
// @ts-ignore
- h.app.refreshViewportBreakpoints();
- // @ts-ignore
- h.app.refreshEditorBreakpoints();
+ h.app.refreshEditorInterface();
window.h.app.refresh();
});
};
diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts
index 3b4d2eb478..cd4f75af2b 100644
--- a/packages/excalidraw/types.ts
+++ b/packages/excalidraw/types.ts
@@ -449,9 +449,6 @@ export interface AppState {
// as elements are unlocked, we remove the groupId from the elements
// and also remove groupId from this map
lockedMultiSelections: { [groupId: string]: true };
-
- /** properties sidebar mode - determines whether to show compact or complete sidebar */
- stylesPanelMode: "compact" | "full" | "mobile";
}
export type SearchMatch = {
@@ -715,7 +712,7 @@ export type AppClassProperties = {
}
>;
files: BinaryFiles;
- device: App["device"];
+ editorInterface: App["editorInterface"];
scene: App["scene"];
syncActionResult: App["syncActionResult"];
fonts: App["fonts"];
@@ -732,6 +729,7 @@ export type AppClassProperties = {
setActiveTool: App["setActiveTool"];
setOpenDialog: App["setOpenDialog"];
insertEmbeddableElement: App["insertEmbeddableElement"];
+ setDesktopUIMode: App["setDesktopUIMode"];
onMagicframeToolSelect: App["onMagicframeToolSelect"];
getName: App["getName"];
dismissLinearEditor: App["dismissLinearEditor"];
@@ -885,16 +883,19 @@ export interface ExcalidrawImperativeAPI {
) => UnsubscribeCallback;
}
-export type Device = Readonly<{
- viewport: {
- isMobile: boolean;
- isLandscape: boolean;
- };
- editor: {
- isMobile: boolean;
- canFitSidebar: boolean;
- };
+export type StylesPanelMode = "compact" | "full" | "mobile";
+
+export type EditorInterface = Readonly<{
+ formFactor: "phone" | "tablet" | "desktop";
+ desktopUIMode: "compact" | "full";
+ userAgent: Readonly<{
+ raw: string;
+ isMobileDevice: boolean;
+ platform: "ios" | "android" | "other" | "unknown";
+ }>;
isTouchScreen: boolean;
+ canFitSidebar: boolean;
+ isLandscape: boolean;
}>;
export type FrameNameBounds = {
diff --git a/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx
index b03fab7391..e4d290a92f 100644
--- a/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx
+++ b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx
@@ -254,9 +254,7 @@ describe("textWysiwyg", () => {
beforeEach(async () => {
await render( );
// @ts-ignore
- h.app.refreshViewportBreakpoints();
- // @ts-ignore
- h.app.refreshEditorBreakpoints();
+ h.app.refreshEditorInterface();
API.setElements([]);
});
@@ -363,9 +361,7 @@ describe("textWysiwyg", () => {
beforeEach(async () => {
await render( );
// @ts-ignore
- h.app.refreshViewportBreakpoints();
- // @ts-ignore
- h.app.refreshEditorBreakpoints();
+ h.app.refreshEditorInterface();
textElement = UI.createElement("text");
diff --git a/packages/utils/tests/__snapshots__/export.test.ts.snap b/packages/utils/tests/__snapshots__/export.test.ts.snap
index 1f799501c9..d3bbff7af7 100644
--- a/packages/utils/tests/__snapshots__/export.test.ts.snap
+++ b/packages/utils/tests/__snapshots__/export.test.ts.snap
@@ -104,7 +104,6 @@ exports[`exportToSvg > with default arguments 1`] = `
"open": false,
"panels": 3,
},
- "stylesPanelMode": "full",
"suggestedBindings": [],
"theme": "light",
"toast": null,