Márk Tolmács 18 hours ago committed by GitHub
parent
commit
44c483b4c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      packages/common/src/editorInterface.ts
  2. 1
      packages/excalidraw/package.json
  3. 5
      yarn.lock

11
packages/common/src/editorInterface.ts

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
import mobile from "is-mobile";
export type StylesPanelMode = "compact" | "full" | "mobile";
export type EditorInterface = Readonly<{
@ -139,12 +141,13 @@ export const getFormFactor = ( @@ -139,12 +141,13 @@ export const getFormFactor = (
editorWidth: number,
editorHeight: number,
): EditorInterface["formFactor"] => {
if (isMobileBreakpoint(editorWidth, editorHeight)) {
if (mobile()) {
return "phone";
}
if (isTabletBreakpoint(editorWidth, editorHeight)) {
} else if (mobile({ tablet: true })) {
return "tablet";
} else if (isMobileBreakpoint(editorWidth, editorHeight)) {
// NOTE: Very small editor sizes should be treated as phone
return "phone";
}
return "desktop";

1
packages/excalidraw/package.json

@ -95,6 +95,7 @@ @@ -95,6 +95,7 @@
"fractional-indexing": "3.2.0",
"fuzzy": "0.1.3",
"image-blob-reduce": "3.0.1",
"is-mobile": "5.0.0",
"jotai": "2.11.0",
"jotai-scope": "0.7.2",
"lodash.debounce": "4.0.8",

5
yarn.lock

@ -6398,6 +6398,11 @@ is-map@^2.0.3: @@ -6398,6 +6398,11 @@ is-map@^2.0.3:
resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e"
integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==
is-mobile@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-5.0.0.tgz#1e08a0ef2c38a67bff84a52af68d67bcef445333"
integrity sha512-Tz/yndySvLAEXh+Uk8liFCxOwVH6YutuR74utvOcu7I9Di+DwM0mtdPVZNaVvvBUM2OXxne/NhOs1zAO7riusQ==
is-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"

Loading…
Cancel
Save