forked from onlook-dev/onlook
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy patheditor.ts
More file actions
94 lines (84 loc) · 2.97 KB
/
editor.ts
File metadata and controls
94 lines (84 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { DEFAULT_IDE } from '../ide/index.ts';
export const APP_NAME = 'Onlook';
export const APP_SCHEMA = 'onlook';
export const HOSTING_DOMAIN = 'onlook.live';
export const CUSTOM_OUTPUT_DIR = '.next-prod';
export const MAX_NAME_LENGTH = 50;
export enum EditorAttributes {
// DOM attributes
ONLOOK_TOOLBAR = 'onlook-toolbar',
ONLOOK_RECT_ID = 'onlook-rect',
ONLOOK_STYLESHEET_ID = 'onlook-stylesheet',
ONLOOK_STUB_ID = 'onlook-drag-stub',
ONLOOK_MOVE_KEY_PREFIX = 'olk-',
OVERLAY_CONTAINER_ID = 'overlay-container',
CANVAS_CONTAINER_ID = 'canvas-container',
// IDs
DATA_ONLOOK_ID = 'data-oid',
DATA_ONLOOK_INSTANCE_ID = 'data-oiid',
DATA_ONLOOK_DOM_ID = 'data-odid',
DATA_ONLOOK_COMPONENT_NAME = 'data-ocname',
// Data attributes
DATA_ONLOOK_IGNORE = 'data-onlook-ignore',
DATA_ONLOOK_INSERTED = 'data-onlook-inserted',
DATA_ONLOOK_DRAG_SAVED_STYLE = 'data-onlook-drag-saved-style',
DATA_ONLOOK_DRAGGING = 'data-onlook-dragging',
DATA_ONLOOK_DRAG_DIRECTION = 'data-onlook-drag-direction',
DATA_ONLOOK_DRAG_START_POSITION = 'data-onlook-drag-start-position',
DATA_ONLOOK_NEW_INDEX = 'data-onlook-new-index',
DATA_ONLOOK_EDITING_TEXT = 'data-onlook-editing-text',
DATA_ONLOOK_DYNAMIC_TYPE = 'data-onlook-dynamic-type',
DATA_ONLOOK_CORE_ELEMENT_TYPE = 'data-onlook-core-element-type',
ONLOOK_DEFAULT_STYLESHEET_ID = 'onlook-default-stylesheet',
}
export enum Links {
DISCORD = 'https://discord.gg/hERDfFZCsH',
GITHUB = 'https://github.com/onlook-dev/onlook',
USAGE_DOCS = 'https://github.com/onlook-dev/onlook/wiki/How-to-set-up-my-project%3F',
WIKI = 'https://github.com/onlook-dev/onlook/wiki',
OPEN_ISSUE = 'https://github.com/onlook-dev/onlook/issues/new/choose',
}
export enum Orientation {
Portrait = 'Portrait',
Landscape = 'Landscape',
}
export enum Theme {
Light = 'light',
Dark = 'dark',
System = 'system',
}
export const DefaultSettings = {
SCALE: 0.7,
PAN_POSITION: { x: 175, y: 100 },
URL: 'http://localhost:3000/',
FRAME_POSITION: { x: 0, y: 0 },
FRAME_DIMENSION: { width: 1536, height: 960 },
ASPECT_RATIO_LOCKED: false,
DEVICE: 'Custom:Custom',
THEME: Theme.System,
ORIENTATION: Orientation.Portrait,
MIN_DIMENSIONS: { width: '280px', height: '360px' },
COMMANDS: {
run: 'npm run dev',
build: 'npm run build',
install: 'npm install',
},
IMAGE_FOLDER: 'public/images',
IMAGE_DIMENSION: { width: '100px', height: '100px' },
FONT_FOLDER: 'public/fonts',
FONT_CONFIG: 'app/fonts.ts',
CHAT_SETTINGS: {
showSuggestions: true,
autoApplyCode: true,
expandCodeBlocks: false,
showMiniChat: true,
},
EDITOR_SETTINGS: {
shouldWarnDelete: true,
ideType: DEFAULT_IDE,
enableBunReplace: true,
buildFlags: '--no-lint',
},
};
export const DEFAULT_COLOR_NAME = 'DEFAULT';
export const RECENT_COLOR_STORAGE_KEY = 'recent-colors';