@invopop/popui 0.1.102 → 0.1.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,6 +15,7 @@ declare class SidebarState {
|
|
|
15
15
|
constructor(props: SidebarStateProps);
|
|
16
16
|
get isMobile(): boolean;
|
|
17
17
|
setWidth: (px: number) => void;
|
|
18
|
+
persistWidth: () => void;
|
|
18
19
|
resetWidth: () => void;
|
|
19
20
|
handleShortcutKeydown: (e: KeyboardEvent) => void;
|
|
20
21
|
setOpenMobile: (value: boolean) => void;
|
|
@@ -26,13 +26,15 @@ class SidebarState {
|
|
|
26
26
|
setWidth = (px) => {
|
|
27
27
|
const clamped = Math.max(SIDEBAR_MIN_WIDTH_PX, Math.min(SIDEBAR_MAX_WIDTH_PX, px));
|
|
28
28
|
this.width = `${clamped}px`;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
};
|
|
30
|
+
persistWidth = () => {
|
|
31
|
+
if (typeof localStorage === 'undefined')
|
|
32
|
+
return;
|
|
33
|
+
try {
|
|
34
|
+
localStorage.setItem(SIDEBAR_WIDTH_STORAGE_KEY, this.width);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// ignore quota / private-mode errors
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
resetWidth = () => {
|