refactor device to editor interface and derive styles panel

This commit is contained in:
Ryan Di
2025-10-15 01:58:09 +11:00
parent 8608d7b2e0
commit 1225fcc339
49 changed files with 704 additions and 680 deletions

View File

@@ -18,26 +18,25 @@ describe("Test MobileMenu", () => {
beforeEach(async () => {
await render(<ExcalidrawApp />);
// @ts-ignore
h.app.refreshViewportBreakpoints();
// @ts-ignore
h.app.refreshEditorBreakpoints();
h.app.refreshEditorInterface();
});
afterAll(() => {
restoreOriginalGetBoundingClientRect();
});
it("should set device correctly", () => {
expect(h.app.device).toMatchInlineSnapshot(`
it("should set editor interface correctly", () => {
expect(h.app.editorInterface).toMatchInlineSnapshot(`
{
"editor": {
"canFitSidebar": false,
"isMobile": true,
},
"canFitSidebar": false,
"desktopUIMode": "full",
"formFactor": "phone",
"isLandscape": true,
"isTouchScreen": false,
"viewport": {
"isLandscape": true,
"isMobile": true,
"userAgent": {
"isMobileDevice": false,
"platform": "other",
"raw": "Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/22.1.0",
},
}
`);