@uiw/codemirror-theme-vscode
Advanced tools
Comparing version 4.22.1 to 4.22.2
@@ -1,4 +0,2 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const defaultSettingsVscodeDark: CreateThemeOptions['settings']; | ||
export declare function vscodeDarkInit(options?: Partial<CreateThemeOptions>): import("@codemirror/state").Extension; | ||
export declare const vscodeDark: import("@codemirror/state").Extension; | ||
export * from './light'; | ||
export * from './dark'; |
111
cjs/index.js
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.vscodeDark = exports.defaultSettingsVscodeDark = void 0; | ||
exports.vscodeDarkInit = vscodeDarkInit; | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _highlight = require("@lezer/highlight"); | ||
var _codemirrorThemes = require("@uiw/codemirror-themes"); | ||
/** | ||
* https://github.com/uiwjs/react-codemirror/issues/409 | ||
*/ | ||
var defaultSettingsVscodeDark = exports.defaultSettingsVscodeDark = { | ||
background: '#1e1e1e', | ||
foreground: '#9cdcfe', | ||
caret: '#c6c6c6', | ||
selection: '#6199ff2f', | ||
selectionMatch: '#72a1ff59', | ||
lineHighlight: '#ffffff0f', | ||
gutterBackground: '#1e1e1e', | ||
gutterForeground: '#838383', | ||
gutterActiveForeground: '#fff', | ||
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace' | ||
}; | ||
function vscodeDarkInit(options) { | ||
var _ref = options || {}, | ||
_ref$theme = _ref.theme, | ||
theme = _ref$theme === void 0 ? 'dark' : _ref$theme, | ||
_ref$settings = _ref.settings, | ||
settings = _ref$settings === void 0 ? {} : _ref$settings, | ||
_ref$styles = _ref.styles, | ||
styles = _ref$styles === void 0 ? [] : _ref$styles; | ||
return (0, _codemirrorThemes.createTheme)({ | ||
theme: theme, | ||
settings: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultSettingsVscodeDark), settings), | ||
styles: [{ | ||
tag: [_highlight.tags.keyword, _highlight.tags.operatorKeyword, _highlight.tags.modifier, _highlight.tags.color, _highlight.tags.constant(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.tagName), _highlight.tags.special(_highlight.tags.brace), _highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)], | ||
color: '#569cd6' | ||
}, { | ||
tag: [_highlight.tags.controlKeyword, _highlight.tags.moduleKeyword], | ||
color: '#c586c0' | ||
}, { | ||
tag: [_highlight.tags.name, _highlight.tags.deleted, _highlight.tags.character, _highlight.tags.macroName, _highlight.tags.propertyName, _highlight.tags.variableName, _highlight.tags.labelName, _highlight.tags.definition(_highlight.tags.name)], | ||
color: '#9cdcfe' | ||
}, { | ||
tag: _highlight.tags.heading, | ||
fontWeight: 'bold', | ||
color: '#9cdcfe' | ||
}, { | ||
tag: [_highlight.tags.typeName, _highlight.tags.className, _highlight.tags.tagName, _highlight.tags.number, _highlight.tags.changed, _highlight.tags.annotation, _highlight.tags.self, _highlight.tags.namespace], | ||
color: '#4ec9b0' | ||
}, { | ||
tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.propertyName)], | ||
color: '#dcdcaa' | ||
}, { | ||
tag: [_highlight.tags.number], | ||
color: '#b5cea8' | ||
}, { | ||
tag: [_highlight.tags.operator, _highlight.tags.punctuation, _highlight.tags.separator, _highlight.tags.url, _highlight.tags.escape, _highlight.tags.regexp], | ||
color: '#d4d4d4' | ||
}, { | ||
tag: [_highlight.tags.regexp], | ||
color: '#d16969' | ||
}, { | ||
tag: [_highlight.tags.special(_highlight.tags.string), _highlight.tags.processingInstruction, _highlight.tags.string, _highlight.tags.inserted], | ||
color: '#ce9178' | ||
}, { | ||
tag: [_highlight.tags.angleBracket], | ||
color: '#808080' | ||
}, { | ||
tag: _highlight.tags.strong, | ||
fontWeight: 'bold' | ||
}, { | ||
tag: _highlight.tags.emphasis, | ||
fontStyle: 'italic' | ||
}, { | ||
tag: _highlight.tags.strikethrough, | ||
textDecoration: 'line-through' | ||
}, { | ||
tag: [_highlight.tags.meta, _highlight.tags.comment], | ||
color: '#6a9955' | ||
}, { | ||
tag: _highlight.tags.link, | ||
color: '#6a9955', | ||
textDecoration: 'underline' | ||
}, { | ||
tag: _highlight.tags.invalid, | ||
color: '#ff0000' | ||
}].concat((0, _toConsumableArray2["default"])(styles)) | ||
var _light = require("./light"); | ||
Object.keys(_light).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _light[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _light[key]; | ||
} | ||
}); | ||
} | ||
var vscodeDark = exports.vscodeDark = vscodeDarkInit(); | ||
}); | ||
var _dark = require("./dark"); | ||
Object.keys(_dark).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _dark[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _dark[key]; | ||
} | ||
}); | ||
}); |
@@ -1,4 +0,2 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const defaultSettingsVscodeDark: CreateThemeOptions['settings']; | ||
export declare function vscodeDarkInit(options?: Partial<CreateThemeOptions>): import("@codemirror/state").Extension; | ||
export declare const vscodeDark: import("@codemirror/state").Extension; | ||
export * from './light'; | ||
export * from './dark'; |
@@ -1,84 +0,2 @@ | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
/** | ||
* https://github.com/uiwjs/react-codemirror/issues/409 | ||
*/ | ||
import { tags as t } from '@lezer/highlight'; | ||
import { createTheme } from '@uiw/codemirror-themes'; | ||
export var defaultSettingsVscodeDark = { | ||
background: '#1e1e1e', | ||
foreground: '#9cdcfe', | ||
caret: '#c6c6c6', | ||
selection: '#6199ff2f', | ||
selectionMatch: '#72a1ff59', | ||
lineHighlight: '#ffffff0f', | ||
gutterBackground: '#1e1e1e', | ||
gutterForeground: '#838383', | ||
gutterActiveForeground: '#fff', | ||
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace' | ||
}; | ||
export function vscodeDarkInit(options) { | ||
var { | ||
theme = 'dark', | ||
settings = {}, | ||
styles = [] | ||
} = options || {}; | ||
return createTheme({ | ||
theme: theme, | ||
settings: _extends({}, defaultSettingsVscodeDark, settings), | ||
styles: [{ | ||
tag: [t.keyword, t.operatorKeyword, t.modifier, t.color, t.constant(t.name), t.standard(t.name), t.standard(t.tagName), t.special(t.brace), t.atom, t.bool, t.special(t.variableName)], | ||
color: '#569cd6' | ||
}, { | ||
tag: [t.controlKeyword, t.moduleKeyword], | ||
color: '#c586c0' | ||
}, { | ||
tag: [t.name, t.deleted, t.character, t.macroName, t.propertyName, t.variableName, t.labelName, t.definition(t.name)], | ||
color: '#9cdcfe' | ||
}, { | ||
tag: t.heading, | ||
fontWeight: 'bold', | ||
color: '#9cdcfe' | ||
}, { | ||
tag: [t.typeName, t.className, t.tagName, t.number, t.changed, t.annotation, t.self, t.namespace], | ||
color: '#4ec9b0' | ||
}, { | ||
tag: [t.function(t.variableName), t.function(t.propertyName)], | ||
color: '#dcdcaa' | ||
}, { | ||
tag: [t.number], | ||
color: '#b5cea8' | ||
}, { | ||
tag: [t.operator, t.punctuation, t.separator, t.url, t.escape, t.regexp], | ||
color: '#d4d4d4' | ||
}, { | ||
tag: [t.regexp], | ||
color: '#d16969' | ||
}, { | ||
tag: [t.special(t.string), t.processingInstruction, t.string, t.inserted], | ||
color: '#ce9178' | ||
}, { | ||
tag: [t.angleBracket], | ||
color: '#808080' | ||
}, { | ||
tag: t.strong, | ||
fontWeight: 'bold' | ||
}, { | ||
tag: t.emphasis, | ||
fontStyle: 'italic' | ||
}, { | ||
tag: t.strikethrough, | ||
textDecoration: 'line-through' | ||
}, { | ||
tag: [t.meta, t.comment], | ||
color: '#6a9955' | ||
}, { | ||
tag: t.link, | ||
color: '#6a9955', | ||
textDecoration: 'underline' | ||
}, { | ||
tag: t.invalid, | ||
color: '#ff0000' | ||
}, ...styles] | ||
}); | ||
} | ||
export var vscodeDark = vscodeDarkInit(); | ||
export * from './light'; | ||
export * from './dark'; |
{ | ||
"name": "@uiw/codemirror-theme-vscode", | ||
"version": "4.22.1", | ||
"version": "4.22.2", | ||
"description": "Theme vscode for CodeMirror.", | ||
@@ -25,3 +25,3 @@ "homepage": "https://uiwjs.github.io/react-codemirror/#/theme/data/vscode", | ||
"dependencies": { | ||
"@uiw/codemirror-themes": "4.22.1" | ||
"@uiw/codemirror-themes": "4.22.2" | ||
}, | ||
@@ -28,0 +28,0 @@ "keywords": [ |
@@ -14,2 +14,6 @@ <!--rehype:ignore:start--> | ||
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/vscode/light"> | ||
<img width="436" alt="codemirror-theme-vscode light" src="https://github.com/uiwjs/react-codemirror/assets/1680273/81b870f6-36b9-46ee-9ded-1650ba8eebc8"> | ||
</a> | ||
## Install | ||
@@ -21,6 +25,11 @@ | ||
```jsx | ||
import { vscodeDark, vscodeDarkInit } from '@uiw/codemirror-theme-vscode'; | ||
import { vscodeLight, vscodeLightInit } from '@uiw/codemirror-theme-vscode'; | ||
``` | ||
```js | ||
import { EditorState } from '@codemirror/state'; | ||
import { javascript } from '@codemirror/lang-javascript'; | ||
import { vscodeDark } from '@uiw/codemirror-theme-vscode'; | ||
import { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode'; | ||
@@ -53,5 +62,10 @@ const state = EditorState.create({ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
// Dark | ||
export declare const defaultSettingsVscodeDark: CreateThemeOptions['settings']; | ||
export declare function vscodeDarkInit(options?: Partial<CreateThemeOptions>): import('@codemirror/state').Extension; | ||
export declare const vscodeDark: import('@codemirror/state').Extension; | ||
// Light | ||
export declare const defaultSettingsVscodeLight: CreateThemeOptions['settings']; | ||
export declare function vscodeLightInit(options?: Partial<CreateThemeOptions>): import('@codemirror/state').Extension; | ||
export declare const vscodeLight: import('@codemirror/state').Extension; | ||
``` | ||
@@ -58,0 +72,0 @@ |
@@ -1,96 +0,2 @@ | ||
/** | ||
* https://github.com/uiwjs/react-codemirror/issues/409 | ||
*/ | ||
import { tags as t } from '@lezer/highlight'; | ||
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export const defaultSettingsVscodeDark: CreateThemeOptions['settings'] = { | ||
background: '#1e1e1e', | ||
foreground: '#9cdcfe', | ||
caret: '#c6c6c6', | ||
selection: '#6199ff2f', | ||
selectionMatch: '#72a1ff59', | ||
lineHighlight: '#ffffff0f', | ||
gutterBackground: '#1e1e1e', | ||
gutterForeground: '#838383', | ||
gutterActiveForeground: '#fff', | ||
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace', | ||
}; | ||
export function vscodeDarkInit(options?: Partial<CreateThemeOptions>) { | ||
const { theme = 'dark', settings = {}, styles = [] } = options || {}; | ||
return createTheme({ | ||
theme: theme, | ||
settings: { | ||
...defaultSettingsVscodeDark, | ||
...settings, | ||
}, | ||
styles: [ | ||
{ | ||
tag: [ | ||
t.keyword, | ||
t.operatorKeyword, | ||
t.modifier, | ||
t.color, | ||
t.constant(t.name), | ||
t.standard(t.name), | ||
t.standard(t.tagName), | ||
t.special(t.brace), | ||
t.atom, | ||
t.bool, | ||
t.special(t.variableName), | ||
], | ||
color: '#569cd6', | ||
}, | ||
{ | ||
tag: [t.controlKeyword, t.moduleKeyword], | ||
color: '#c586c0', | ||
}, | ||
{ | ||
tag: [ | ||
t.name, | ||
t.deleted, | ||
t.character, | ||
t.macroName, | ||
t.propertyName, | ||
t.variableName, | ||
t.labelName, | ||
t.definition(t.name), | ||
], | ||
color: '#9cdcfe', | ||
}, | ||
{ tag: t.heading, fontWeight: 'bold', color: '#9cdcfe' }, | ||
{ | ||
tag: [t.typeName, t.className, t.tagName, t.number, t.changed, t.annotation, t.self, t.namespace], | ||
color: '#4ec9b0', | ||
}, | ||
{ | ||
tag: [t.function(t.variableName), t.function(t.propertyName)], | ||
color: '#dcdcaa', | ||
}, | ||
{ tag: [t.number], color: '#b5cea8' }, | ||
{ | ||
tag: [t.operator, t.punctuation, t.separator, t.url, t.escape, t.regexp], | ||
color: '#d4d4d4', | ||
}, | ||
{ | ||
tag: [t.regexp], | ||
color: '#d16969', | ||
}, | ||
{ | ||
tag: [t.special(t.string), t.processingInstruction, t.string, t.inserted], | ||
color: '#ce9178', | ||
}, | ||
{ tag: [t.angleBracket], color: '#808080' }, | ||
{ tag: t.strong, fontWeight: 'bold' }, | ||
{ tag: t.emphasis, fontStyle: 'italic' }, | ||
{ tag: t.strikethrough, textDecoration: 'line-through' }, | ||
{ tag: [t.meta, t.comment], color: '#6a9955' }, | ||
{ tag: t.link, color: '#6a9955', textDecoration: 'underline' }, | ||
{ tag: t.invalid, color: '#ff0000' }, | ||
...styles, | ||
], | ||
}); | ||
} | ||
export const vscodeDark = vscodeDarkInit(); | ||
export * from './light' | ||
export * from './dark' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25364
17
588
123
1
+ Added@uiw/codemirror-themes@4.22.2(transitive)
- Removed@uiw/codemirror-themes@4.22.1(transitive)