@uiw/codemirror-theme-dracula
Advanced tools
Comparing version 4.22.2 to 4.23.0
@@ -1,4 +0,5 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
import { type CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const defaultSettingsDracula: CreateThemeOptions['settings']; | ||
export declare const draculaDarkStyle: CreateThemeOptions['styles']; | ||
export declare const draculaInit: (options?: Partial<CreateThemeOptions>) => import("@codemirror/state").Extension; | ||
export declare const dracula: import("@codemirror/state").Extension; |
@@ -7,3 +7,3 @@ "use strict"; | ||
}); | ||
exports.draculaInit = exports.dracula = exports.defaultSettingsDracula = void 0; | ||
exports.draculaInit = exports.draculaDarkStyle = exports.dracula = exports.defaultSettingsDracula = void 0; | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
@@ -31,2 +31,27 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
}; | ||
var draculaDarkStyle = exports.draculaDarkStyle = [{ | ||
tag: _highlight.tags.comment, | ||
color: '#6272a4' | ||
}, { | ||
tag: _highlight.tags.string, | ||
color: '#f1fa8c' | ||
}, { | ||
tag: _highlight.tags.atom, | ||
color: '#bd93f9' | ||
}, { | ||
tag: _highlight.tags.meta, | ||
color: '#f8f8f2' | ||
}, { | ||
tag: [_highlight.tags.keyword, _highlight.tags.operator, _highlight.tags.tagName], | ||
color: '#ff79c6' | ||
}, { | ||
tag: [_highlight.tags["function"](_highlight.tags.propertyName), _highlight.tags.propertyName], | ||
color: '#66d9ef' | ||
}, { | ||
tag: [_highlight.tags.definition(_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.variableName), _highlight.tags.className, _highlight.tags.attributeName], | ||
color: '#50fa7b' | ||
}, { | ||
tag: _highlight.tags.atom, | ||
color: '#bd93f9' | ||
}]; | ||
var draculaInit = exports.draculaInit = function draculaInit(options) { | ||
@@ -43,29 +68,5 @@ var _ref = options || {}, | ||
settings: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultSettingsDracula), settings), | ||
styles: [{ | ||
tag: _highlight.tags.comment, | ||
color: '#6272a4' | ||
}, { | ||
tag: _highlight.tags.string, | ||
color: '#f1fa8c' | ||
}, { | ||
tag: _highlight.tags.atom, | ||
color: '#bd93f9' | ||
}, { | ||
tag: _highlight.tags.meta, | ||
color: '#f8f8f2' | ||
}, { | ||
tag: [_highlight.tags.keyword, _highlight.tags.operator, _highlight.tags.tagName], | ||
color: '#ff79c6' | ||
}, { | ||
tag: [_highlight.tags["function"](_highlight.tags.propertyName), _highlight.tags.propertyName], | ||
color: '#66d9ef' | ||
}, { | ||
tag: [_highlight.tags.definition(_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.variableName), _highlight.tags.className, _highlight.tags.attributeName], | ||
color: '#50fa7b' | ||
}, { | ||
tag: _highlight.tags.atom, | ||
color: '#bd93f9' | ||
}].concat((0, _toConsumableArray2["default"])(styles)) | ||
styles: [].concat(draculaDarkStyle, (0, _toConsumableArray2["default"])(styles)) | ||
}); | ||
}; | ||
var dracula = exports.dracula = draculaInit(); |
@@ -1,4 +0,5 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
import { type CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const defaultSettingsDracula: CreateThemeOptions['settings']; | ||
export declare const draculaDarkStyle: CreateThemeOptions['styles']; | ||
export declare const draculaInit: (options?: Partial<CreateThemeOptions>) => import("@codemirror/state").Extension; | ||
export declare const dracula: import("@codemirror/state").Extension; |
@@ -21,2 +21,27 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
}; | ||
export var draculaDarkStyle = [{ | ||
tag: t.comment, | ||
color: '#6272a4' | ||
}, { | ||
tag: t.string, | ||
color: '#f1fa8c' | ||
}, { | ||
tag: t.atom, | ||
color: '#bd93f9' | ||
}, { | ||
tag: t.meta, | ||
color: '#f8f8f2' | ||
}, { | ||
tag: [t.keyword, t.operator, t.tagName], | ||
color: '#ff79c6' | ||
}, { | ||
tag: [t.function(t.propertyName), t.propertyName], | ||
color: '#66d9ef' | ||
}, { | ||
tag: [t.definition(t.variableName), t.function(t.variableName), t.className, t.attributeName], | ||
color: '#50fa7b' | ||
}, { | ||
tag: t.atom, | ||
color: '#bd93f9' | ||
}]; | ||
export var draculaInit = options => { | ||
@@ -31,29 +56,5 @@ var { | ||
settings: _extends({}, defaultSettingsDracula, settings), | ||
styles: [{ | ||
tag: t.comment, | ||
color: '#6272a4' | ||
}, { | ||
tag: t.string, | ||
color: '#f1fa8c' | ||
}, { | ||
tag: t.atom, | ||
color: '#bd93f9' | ||
}, { | ||
tag: t.meta, | ||
color: '#f8f8f2' | ||
}, { | ||
tag: [t.keyword, t.operator, t.tagName], | ||
color: '#ff79c6' | ||
}, { | ||
tag: [t.function(t.propertyName), t.propertyName], | ||
color: '#66d9ef' | ||
}, { | ||
tag: [t.definition(t.variableName), t.function(t.variableName), t.className, t.attributeName], | ||
color: '#50fa7b' | ||
}, { | ||
tag: t.atom, | ||
color: '#bd93f9' | ||
}, ...styles] | ||
styles: [...draculaDarkStyle, ...styles] | ||
}); | ||
}; | ||
export var dracula = draculaInit(); |
{ | ||
"name": "@uiw/codemirror-theme-dracula", | ||
"version": "4.22.2", | ||
"version": "4.23.0", | ||
"description": "Theme dracula for CodeMirror.", | ||
@@ -25,3 +25,3 @@ "homepage": "https://uiwjs.github.io/react-codemirror/#/theme/data/dracula", | ||
"dependencies": { | ||
"@uiw/codemirror-themes": "4.22.2" | ||
"@uiw/codemirror-themes": "4.23.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "keywords": [ |
@@ -8,3 +8,3 @@ /** | ||
import { tags as t } from '@lezer/highlight'; | ||
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
@@ -23,2 +23,16 @@ export const defaultSettingsDracula: CreateThemeOptions['settings'] = { | ||
export const draculaDarkStyle: CreateThemeOptions['styles'] = [ | ||
{ tag: t.comment, color: '#6272a4' }, | ||
{ tag: t.string, color: '#f1fa8c' }, | ||
{ tag: t.atom, color: '#bd93f9' }, | ||
{ tag: t.meta, color: '#f8f8f2' }, | ||
{ tag: [t.keyword, t.operator, t.tagName], color: '#ff79c6' }, | ||
{ tag: [t.function(t.propertyName), t.propertyName], color: '#66d9ef' }, | ||
{ | ||
tag: [t.definition(t.variableName), t.function(t.variableName), t.className, t.attributeName], | ||
color: '#50fa7b', | ||
}, | ||
{ tag: t.atom, color: '#bd93f9' }, | ||
]; | ||
export const draculaInit = (options?: Partial<CreateThemeOptions>) => { | ||
@@ -32,16 +46,3 @@ const { theme = 'dark', settings = {}, styles = [] } = options || {}; | ||
}, | ||
styles: [ | ||
{ tag: t.comment, color: '#6272a4' }, | ||
{ tag: t.string, color: '#f1fa8c' }, | ||
{ tag: t.atom, color: '#bd93f9' }, | ||
{ tag: t.meta, color: '#f8f8f2' }, | ||
{ tag: [t.keyword, t.operator, t.tagName], color: '#ff79c6' }, | ||
{ tag: [t.function(t.propertyName), t.propertyName], color: '#66d9ef' }, | ||
{ | ||
tag: [t.definition(t.variableName), t.function(t.variableName), t.className, t.attributeName], | ||
color: '#50fa7b', | ||
}, | ||
{ tag: t.atom, color: '#bd93f9' }, | ||
...styles, | ||
], | ||
styles: [...draculaDarkStyle, ...styles], | ||
}); | ||
@@ -48,0 +49,0 @@ }; |
10284
177
+ Added@uiw/codemirror-themes@4.23.0(transitive)
- Removed@uiw/codemirror-themes@4.22.2(transitive)