You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
carbon/lib/constants.js

312 lines
4.2 KiB
JavaScript

import toHash from 'tohash'
7 years ago
export const THEMES_ARRAY = [
7 years ago
{
id: '3024-night',
name: '3024 Night'
},
{
id: 'ambiance',
name: 'Ambiance'
},
{
id: 'blackboard',
name: 'Blackboard'
},
{
id: 'cobalt',
name: 'Cobalt'
},
{
id: 'dracula',
name: 'Dracula'
},
{
7 years ago
id: 'duotone-dark',
name: 'Duotone'
},
{
7 years ago
id: 'hopscotch',
name: 'Hopscotch'
},
{
7 years ago
id: 'material',
name: 'Material'
},
{
7 years ago
id: 'monokai',
name: 'Monokai'
},
{
id: 'panda-syntax',
name: 'Panda'
},
{
id: 'paraiso-dark',
name: 'Paraiso'
},
{
7 years ago
id: 'seti',
name: 'Seti'
},
{
7 years ago
id: 'solarized',
name: 'Solarized',
light: true
},
{
7 years ago
id: 'twilight',
name: 'Twilight'
},
{
7 years ago
id: 'yeti',
name: 'Yeti',
light: true
},
{
7 years ago
id: 'zenburn',
name: 'Zenburn'
}
]
export const THEMES = toHash(THEMES_ARRAY)
7 years ago
export const LANGUAGES = [
{
name: 'Auto',
module: 'auto'
},
{
name: 'Plain Text'
},
{
name: 'C',
module: 'clike'
},
{
name: 'Clojure',
module: 'clojure'
},
{
name: 'Cobol',
module: 'cobol'
},
{
name: 'CoffeeScript',
module: 'coffeescript'
},
{
name: 'Crystal',
module: 'crystal'
},
{
name: 'CSS',
module: 'css'
},
{
name: 'D',
module: 'd'
},
{
name: 'Dart',
module: 'dart'
},
{
name: 'Django',
module: 'django'
},
{
name: 'Docker',
module: 'dockerfile'
},
{
name: 'Elm',
module: 'elm'
},
{
name: 'Erlang',
module: 'erlang'
},
{
name: 'Fortran',
module: 'fortran'
},
{
name: 'F# / OCaml',
module: 'mllike'
},
{
name: 'Go',
module: 'go'
},
{
name: 'Groovy',
module: 'groovy'
},
{
name: 'Handlebars',
module: 'handlebars'
},
{
name: 'Haskell',
module: 'haskell'
},
{
name: 'Haxe',
module: 'haxe'
},
{
name: 'HTML',
module: 'htmlmixed'
},
{
name: 'JavaScript',
module: 'javascript'
},
7 years ago
{
name: 'JSX',
module: 'jsx'
},
{
name: 'Julia',
module: 'julia'
},
{
name: 'Kotlin',
module: 'kotlin',
custom: true
},
{
name: 'Lisp',
module: 'commonlisp'
},
{
name: 'Lua',
module: 'lua'
},
{
name: 'Markdown',
module: 'markdown'
},
{
name: 'Mathematica',
module: 'mathematica'
},
{
name: 'NGINX',
module: 'nginx'
},
7 years ago
{
name: 'Nim',
module: 'nimrod',
custom: true
7 years ago
},
{
name: 'Pascal',
module: 'pascal'
},
{
name: 'Perl',
module: 'perl'
},
{
name: 'PHP',
module: 'php'
},
{
name: 'Python',
module: 'python'
},
{
name: 'R',
module: 'r'
},
{
name: 'Ruby',
module: 'ruby'
},
{
name: 'Rust',
module: 'rust'
},
{
name: 'Sass',
module: 'sass'
},
{
name: 'Scala',
module: 'clike'
},
{
name: 'Smalltalk',
module: 'smalltalk'
},
{
name: 'SQL',
module: 'sql'
},
{
name: 'Swift',
module: 'swift'
},
{
name: 'TCL',
module: 'tcl'
},
{
name: 'VB.NET',
module: 'vb'
},
{
name: 'Verilog',
module: 'verilog'
},
{
name: 'VHDL',
module: 'vhdl'
},
{
name: 'Vue',
module: 'vue'
},
{
name: 'XML',
module: 'xml'
},
{
name: 'YAML',
module: 'yaml'
}
]
export const DEFAULT_LANGUAGE = 'auto'
export const COLORS = {
BLACK: '#121212',
7 years ago
PRIMARY: '#F8E81C',
SECONDARY: '#fff',
7 years ago
GRAY: '#858585'
}
export const DEFAULT_CODE = `const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
}
return go(f, seed, [])
}`
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
7 years ago
LANGUAGES.filter(language => language.module !== 'auto').forEach(language => {
if (language.module) {
!language.custom
? require(`codemirror/mode/${language.module}/${language.module}`)
: require(`./customModes/${language.module}`)
}
})
}