@uiw/codemirror-theme-atomone
Advanced tools
Comparing version 4.17.1 to 4.18.0
@@ -0,1 +1,3 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const atomoneInit: (options?: CreateThemeOptions) => import("@codemirror/state").Extension; | ||
export declare const atomone: import("@codemirror/state").Extension; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.atomone = void 0; | ||
exports.atomoneInit = exports.atomone = void 0; | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _highlight = require("@lezer/highlight"); | ||
@@ -16,41 +19,52 @@ var _codemirrorThemes = require("@uiw/codemirror-themes"); | ||
var atomone = (0, _codemirrorThemes.createTheme)({ | ||
theme: 'dark', | ||
settings: { | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D' | ||
}, | ||
styles: [{ | ||
tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.propertyName), _highlight.tags.url, _highlight.tags.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)' | ||
}, { | ||
tag: [_highlight.tags.tagName, _highlight.tags.heading], | ||
color: '#e06c75' | ||
}, { | ||
tag: _highlight.tags.comment, | ||
color: '#54636D' | ||
}, { | ||
tag: [_highlight.tags.propertyName], | ||
color: 'hsl(220, 14%, 71%)' | ||
}, { | ||
tag: [_highlight.tags.attributeName, _highlight.tags.number], | ||
color: 'hsl( 29, 54%, 61%)' | ||
}, { | ||
tag: _highlight.tags.className, | ||
color: 'hsl( 39, 67%, 69%)' | ||
}, { | ||
tag: _highlight.tags.keyword, | ||
color: 'hsl(286, 60%, 67%)' | ||
}, { | ||
tag: [_highlight.tags.string, _highlight.tags.regexp, _highlight.tags.special(_highlight.tags.propertyName)], | ||
color: '#98c379' | ||
}] | ||
}); | ||
var atomoneInit = function atomoneInit(options) { | ||
var _ref = options || {}, | ||
_ref$theme = _ref.theme, | ||
theme = _ref$theme === void 0 ? 'light' : _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"])({ | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D' | ||
}, settings), | ||
styles: [{ | ||
tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.propertyName), _highlight.tags.url, _highlight.tags.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)' | ||
}, { | ||
tag: [_highlight.tags.tagName, _highlight.tags.heading], | ||
color: '#e06c75' | ||
}, { | ||
tag: _highlight.tags.comment, | ||
color: '#54636D' | ||
}, { | ||
tag: [_highlight.tags.propertyName], | ||
color: 'hsl(220, 14%, 71%)' | ||
}, { | ||
tag: [_highlight.tags.attributeName, _highlight.tags.number], | ||
color: 'hsl( 29, 54%, 61%)' | ||
}, { | ||
tag: _highlight.tags.className, | ||
color: 'hsl( 39, 67%, 69%)' | ||
}, { | ||
tag: _highlight.tags.keyword, | ||
color: 'hsl(286, 60%, 67%)' | ||
}, { | ||
tag: [_highlight.tags.string, _highlight.tags.regexp, _highlight.tags.special(_highlight.tags.propertyName)], | ||
color: '#98c379' | ||
}].concat((0, _toConsumableArray2["default"])(styles)) | ||
}); | ||
}; | ||
exports.atomoneInit = atomoneInit; | ||
var atomone = atomoneInit(); | ||
exports.atomone = atomone; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const atomoneInit: (options?: CreateThemeOptions) => import("@codemirror/state").Extension; | ||
export declare const atomone: import("@codemirror/state").Extension; |
@@ -0,1 +1,2 @@ | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
/** | ||
@@ -9,40 +10,48 @@ * @name Atom One | ||
import { createTheme } from '@uiw/codemirror-themes'; | ||
export var atomone = createTheme({ | ||
theme: 'dark', | ||
settings: { | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D' | ||
}, | ||
styles: [{ | ||
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)' | ||
}, { | ||
tag: [t.tagName, t.heading], | ||
color: '#e06c75' | ||
}, { | ||
tag: t.comment, | ||
color: '#54636D' | ||
}, { | ||
tag: [t.propertyName], | ||
color: 'hsl(220, 14%, 71%)' | ||
}, { | ||
tag: [t.attributeName, t.number], | ||
color: 'hsl( 29, 54%, 61%)' | ||
}, { | ||
tag: t.className, | ||
color: 'hsl( 39, 67%, 69%)' | ||
}, { | ||
tag: t.keyword, | ||
color: 'hsl(286, 60%, 67%)' | ||
}, { | ||
tag: [t.string, t.regexp, t.special(t.propertyName)], | ||
color: '#98c379' | ||
}] | ||
}); | ||
export var atomoneInit = options => { | ||
var { | ||
theme = 'light', | ||
settings = {}, | ||
styles = [] | ||
} = options || {}; | ||
return createTheme({ | ||
theme: theme, | ||
settings: _extends({ | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D' | ||
}, settings), | ||
styles: [{ | ||
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)' | ||
}, { | ||
tag: [t.tagName, t.heading], | ||
color: '#e06c75' | ||
}, { | ||
tag: t.comment, | ||
color: '#54636D' | ||
}, { | ||
tag: [t.propertyName], | ||
color: 'hsl(220, 14%, 71%)' | ||
}, { | ||
tag: [t.attributeName, t.number], | ||
color: 'hsl( 29, 54%, 61%)' | ||
}, { | ||
tag: t.className, | ||
color: 'hsl( 39, 67%, 69%)' | ||
}, { | ||
tag: t.keyword, | ||
color: 'hsl(286, 60%, 67%)' | ||
}, { | ||
tag: [t.string, t.regexp, t.special(t.propertyName)], | ||
color: '#98c379' | ||
}, ...styles] | ||
}); | ||
}; | ||
export var atomone = atomoneInit(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/codemirror-theme-atomone", | ||
"version": "4.17.1", | ||
"version": "4.18.0", | ||
"description": "Theme atomone for CodeMirror.", | ||
@@ -24,3 +24,3 @@ "homepage": "https://uiwjs.github.io/react-codemirror/#/theme/data/atomone", | ||
"dependencies": { | ||
"@uiw/codemirror-themes": "4.17.1" | ||
"@uiw/codemirror-themes": "4.18.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "keywords": [ |
@@ -19,2 +19,28 @@ <!--rehype:ignore:start--> | ||
```jsx | ||
import { tags as t } from '@lezer/highlight'; | ||
import { atomone, atomoneInit } from '@uiw/codemirror-theme-atomone'; | ||
<CodeMirror theme={atomone} /> | ||
<CodeMirror | ||
theme={atomoneInit({ | ||
settings: { | ||
caret: '#c6c6c6', | ||
fontFamily: 'monospace', | ||
}, | ||
styles: [ | ||
{ tag: t.comment, color: '#6272a4' }, | ||
] | ||
})} | ||
/> | ||
``` | ||
## API | ||
```tsx | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export declare const atomoneInit: (options?: CreateThemeOptions) => import('@codemirror/state').Extension; | ||
export declare const atomone: import('@codemirror/state').Extension; | ||
``` | ||
## Usage | ||
@@ -21,0 +47,0 @@ |
@@ -8,29 +8,36 @@ /** | ||
import { tags as t } from '@lezer/highlight'; | ||
import { createTheme } from '@uiw/codemirror-themes'; | ||
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export const atomone = createTheme({ | ||
theme: 'dark', | ||
settings: { | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D', | ||
}, | ||
styles: [ | ||
{ | ||
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)', | ||
export const atomoneInit = (options?: CreateThemeOptions) => { | ||
const { theme = 'light', settings = {}, styles = [] } = options || {}; | ||
return createTheme({ | ||
theme: theme, | ||
settings: { | ||
background: '#272C35', | ||
foreground: '#9d9b97', | ||
caret: '#797977', | ||
selection: '#ffffff30', | ||
selectionMatch: '#2B323D', | ||
gutterBackground: '#272C35', | ||
gutterForeground: '#465063', | ||
lineHighlight: '#2B323D', | ||
...settings, | ||
}, | ||
{ tag: [t.tagName, t.heading], color: '#e06c75' }, | ||
{ tag: t.comment, color: '#54636D' }, | ||
{ tag: [t.propertyName], color: 'hsl(220, 14%, 71%)' }, | ||
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' }, | ||
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' }, | ||
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' }, | ||
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' }, | ||
], | ||
}); | ||
styles: [ | ||
{ | ||
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], | ||
color: 'hsl(207, 82%, 66%)', | ||
}, | ||
{ tag: [t.tagName, t.heading], color: '#e06c75' }, | ||
{ tag: t.comment, color: '#54636D' }, | ||
{ tag: [t.propertyName], color: 'hsl(220, 14%, 71%)' }, | ||
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' }, | ||
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' }, | ||
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' }, | ||
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' }, | ||
...styles, | ||
], | ||
}); | ||
}; | ||
export const atomone = atomoneInit(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15968
167
98
+ Added@uiw/codemirror-themes@4.18.0(transitive)
- Removed@uiw/codemirror-themes@4.17.1(transitive)