2020-03-07 10:20:38 -05:00
|
|
|
export const DRAGGING_THRESHOLD = 10; // 10px
|
2020-04-09 01:46:47 -07:00
|
|
|
export const LINE_CONFIRM_THRESHOLD = 10; // 10px
|
2020-03-07 10:20:38 -05:00
|
|
|
export const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
|
|
export const ELEMENT_TRANSLATE_AMOUNT = 1;
|
|
|
|
export const TEXT_TO_CENTER_SNAP_THRESHOLD = 30;
|
2020-05-23 17:45:05 +09:00
|
|
|
export const SHIFT_LOCKING_ANGLE = Math.PI / 12;
|
2020-03-07 10:20:38 -05:00
|
|
|
export const CURSOR_TYPE = {
|
|
|
|
TEXT: "text",
|
|
|
|
CROSSHAIR: "crosshair",
|
|
|
|
GRABBING: "grabbing",
|
2020-03-18 16:43:06 +01:00
|
|
|
POINTER: "pointer",
|
2020-03-07 10:20:38 -05:00
|
|
|
};
|
|
|
|
export const POINTER_BUTTON = {
|
|
|
|
MAIN: 0,
|
|
|
|
WHEEL: 1,
|
|
|
|
SECONDARY: 2,
|
|
|
|
TOUCH: -1,
|
|
|
|
};
|
2020-04-12 06:12:02 +05:30
|
|
|
|
|
|
|
export enum SCENE {
|
|
|
|
INIT = "SCENE_INIT",
|
|
|
|
UPDATE = "SCENE_UPDATE",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum EVENT {
|
|
|
|
COPY = "copy",
|
|
|
|
PASTE = "paste",
|
|
|
|
CUT = "cut",
|
|
|
|
KEYDOWN = "keydown",
|
|
|
|
KEYUP = "keyup",
|
|
|
|
MOUSE_MOVE = "mousemove",
|
|
|
|
RESIZE = "resize",
|
|
|
|
UNLOAD = "unload",
|
|
|
|
BLUR = "blur",
|
|
|
|
DRAG_OVER = "dragover",
|
|
|
|
DROP = "drop",
|
|
|
|
GESTURE_END = "gestureend",
|
|
|
|
BEFORE_UNLOAD = "beforeunload",
|
|
|
|
GESTURE_START = "gesturestart",
|
|
|
|
GESTURE_CHANGE = "gesturechange",
|
|
|
|
POINTER_MOVE = "pointermove",
|
|
|
|
POINTER_UP = "pointerup",
|
2020-05-13 19:19:49 +02:00
|
|
|
STATE_CHANGE = "statechange",
|
2020-04-12 06:12:02 +05:30
|
|
|
WHEEL = "wheel",
|
|
|
|
TOUCH_START = "touchstart",
|
2020-06-02 18:41:40 +02:00
|
|
|
TOUCH_END = "touchend",
|
2020-04-12 06:12:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export const ENV = {
|
|
|
|
TEST: "test",
|
|
|
|
DEVELOPMENT: "development",
|
|
|
|
};
|
2020-04-12 16:24:52 +05:30
|
|
|
|
|
|
|
export const BROADCAST = {
|
|
|
|
SERVER_VOLATILE: "server-volatile-broadcast",
|
|
|
|
SERVER: "server-broadcast",
|
|
|
|
};
|
2020-04-12 15:57:57 +02:00
|
|
|
|
|
|
|
export const CLASSES = {
|
|
|
|
SHAPE_ACTIONS_MENU: "App-menu__left",
|
|
|
|
};
|
2020-05-27 15:14:50 +02:00
|
|
|
|
|
|
|
// 1-based in case we ever do `if(element.fontFamily)`
|
|
|
|
export const FONT_FAMILY = {
|
|
|
|
1: "Virgil",
|
|
|
|
2: "Helvetica",
|
|
|
|
3: "Cascadia",
|
|
|
|
} as const;
|
2020-05-30 18:56:17 +05:30
|
|
|
|
|
|
|
export const CANVAS_ONLY_ACTIONS = ["selectAll"];
|
2020-06-24 00:24:52 +09:00
|
|
|
|
|
|
|
export const GRID_SIZE = 20; // TODO make it configurable?
|