-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathscripting-enabled-frameworks.ts
51 lines (46 loc) · 1.18 KB
/
scripting-enabled-frameworks.ts
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
import type { FrameworkConfig } from "@designto/config";
type Framework = FrameworkConfig["framework"];
interface FrameworkEditorSciprtingPreviewConfig {
nativePreview: boolean;
nativeScripting: boolean;
enabled: boolean;
}
/**
* a config map by frameworks containing supported scripting and preview features.
*/
export const scripting_and_preview_framework_config: {
[key in Framework]: FrameworkEditorSciprtingPreviewConfig;
} = {
vanilla: {
nativePreview: true,
nativeScripting: true,
enabled: true,
},
react: {
nativePreview: true,
nativeScripting: true,
enabled: true,
},
"react-native": {
nativePreview: false,
nativeScripting: false,
enabled: false,
},
flutter: {
nativePreview: false,
nativeScripting: false,
enabled: false,
},
"solid-js": {
nativePreview: false,
nativeScripting: false,
enabled: false,
},
preview: null,
} as const;
export function supportsScripting(framework: Framework) {
return scripting_and_preview_framework_config[framework].nativeScripting;
}
export function supportsPreview(framework: Framework) {
return scripting_and_preview_framework_config[framework].nativePreview;
}