2021-02-16 06:17:23 +00:00
|
|
|
import localStorage from "utils/localStorage";
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
export const CANVAS_DEFAULT_HEIGHT_PX = 1292;
|
2020-01-16 11:46:21 +00:00
|
|
|
export const CANVAS_DEFAULT_GRID_HEIGHT_PX = 1;
|
|
|
|
|
export const CANVAS_DEFAULT_GRID_WIDTH_PX = 1;
|
|
|
|
|
export const CANVAS_BACKGROUND_COLOR = "#FFFFFF";
|
2021-11-23 08:01:46 +00:00
|
|
|
export const DEFAULT_ENTITY_EXPLORER_WIDTH = 256;
|
|
|
|
|
export const DEFAULT_PROPERTY_PANE_WIDTH = 256;
|
2020-08-20 15:17:20 +00:00
|
|
|
|
2020-08-24 12:09:17 +00:00
|
|
|
const APP_STORE_NAMESPACE = "APPSMITH_LOCAL_STORE";
|
|
|
|
|
|
2021-10-18 14:03:44 +00:00
|
|
|
export const getAppStoreName = (appId: string, branch?: string) =>
|
|
|
|
|
branch
|
|
|
|
|
? `${APP_STORE_NAMESPACE}-${appId}-${branch}`
|
|
|
|
|
: `${APP_STORE_NAMESPACE}-${appId}`;
|
2020-11-04 11:40:59 +00:00
|
|
|
|
2021-10-18 14:03:44 +00:00
|
|
|
export const getPersistentAppStore = (appId: string, branch?: string) => {
|
|
|
|
|
const appStoreName = getAppStoreName(appId, branch);
|
2020-11-04 11:40:59 +00:00
|
|
|
let storeString = "{}";
|
|
|
|
|
// Check if localStorage exists
|
2021-02-16 06:17:23 +00:00
|
|
|
if (localStorage.isSupported()) {
|
2020-11-04 11:40:59 +00:00
|
|
|
const appStore = localStorage.getItem(appStoreName);
|
|
|
|
|
if (appStore) storeString = appStore;
|
|
|
|
|
}
|
|
|
|
|
let store;
|
|
|
|
|
try {
|
|
|
|
|
store = JSON.parse(storeString);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
store = {};
|
|
|
|
|
}
|
|
|
|
|
return store;
|
|
|
|
|
};
|
2021-10-08 07:05:34 +00:00
|
|
|
|
|
|
|
|
export const TOOLTIP_HOVER_ON_DELAY = 1000;
|
2022-02-17 16:38:36 +00:00
|
|
|
|
|
|
|
|
export const MOBILE_MAX_WIDTH = 767;
|
|
|
|
|
export const TABLET_MIN_WIDTH = 768;
|
|
|
|
|
export const TABLET_MAX_WIDTH = 991;
|
|
|
|
|
export const DESKTOP_MIN_WIDTH = 992;
|