@uiw/codemirror-theme-sublime 4.17.1 → 4.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +57 -43
- package/cjs/index.js.map +8 -6
- package/esm/index.d.ts +2 -0
- package/esm/index.js +52 -43
- package/esm/index.js.map +7 -5
- package/package.json +2 -2
- package/src/index.ts +33 -26
package/README.md
CHANGED
|
@@ -16,6 +16,28 @@
|
|
|
16
16
|
npm install @uiw/codemirror-theme-sublime --save
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
```jsx
|
|
20
|
+
import { sublime, sublimeInit } from '@uiw/codemirror-theme-sublime';
|
|
21
|
+
|
|
22
|
+
<CodeMirror theme={sublime} />
|
|
23
|
+
<CodeMirror
|
|
24
|
+
theme={sublimeInit({
|
|
25
|
+
settings: {
|
|
26
|
+
caret: '#c6c6c6',
|
|
27
|
+
fontFamily: 'monospace',
|
|
28
|
+
}
|
|
29
|
+
})}
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { CreateThemeOptions } from '@uiw/codemirror-themes';
|
|
37
|
+
export declare function sublimeInit(options?: CreateThemeOptions): import('@codemirror/state').Extension;
|
|
38
|
+
export declare const sublime: import('@codemirror/state').Extension;
|
|
39
|
+
```
|
|
40
|
+
|
|
19
41
|
## Usage
|
|
20
42
|
|
|
21
43
|
```jsx
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -1,53 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.sublime = void 0;
|
|
8
|
+
exports.sublimeInit = sublimeInit;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
7
11
|
var _highlight = require("@lezer/highlight");
|
|
8
12
|
var _codemirrorThemes = require("@uiw/codemirror-themes");
|
|
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
|
-
tag:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
13
|
+
function sublimeInit(options) {
|
|
14
|
+
var _ref = options || {},
|
|
15
|
+
_ref$theme = _ref.theme,
|
|
16
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
|
|
17
|
+
_ref$settings = _ref.settings,
|
|
18
|
+
settings = _ref$settings === void 0 ? {} : _ref$settings,
|
|
19
|
+
_ref$styles = _ref.styles,
|
|
20
|
+
styles = _ref$styles === void 0 ? [] : _ref$styles;
|
|
21
|
+
return (0, _codemirrorThemes.createTheme)({
|
|
22
|
+
theme: theme,
|
|
23
|
+
settings: (0, _objectSpread2["default"])({
|
|
24
|
+
background: '#303841',
|
|
25
|
+
foreground: '#FFFFFF',
|
|
26
|
+
caret: '#FBAC52',
|
|
27
|
+
selection: '#4C5964',
|
|
28
|
+
selectionMatch: '#3A546E',
|
|
29
|
+
gutterBackground: '#303841',
|
|
30
|
+
gutterForeground: '#FFFFFF70',
|
|
31
|
+
lineHighlight: '#00000059'
|
|
32
|
+
}, settings),
|
|
33
|
+
styles: [{
|
|
34
|
+
tag: [_highlight.tags.meta, _highlight.tags.comment],
|
|
35
|
+
color: '#A2A9B5'
|
|
36
|
+
}, {
|
|
37
|
+
tag: [_highlight.tags.attributeName, _highlight.tags.keyword],
|
|
38
|
+
color: '#B78FBA'
|
|
39
|
+
}, {
|
|
40
|
+
tag: _highlight.tags["function"](_highlight.tags.variableName),
|
|
41
|
+
color: '#5AB0B0'
|
|
42
|
+
}, {
|
|
43
|
+
tag: [_highlight.tags.string, _highlight.tags.regexp, _highlight.tags.attributeValue],
|
|
44
|
+
color: '#99C592'
|
|
45
|
+
}, {
|
|
46
|
+
tag: _highlight.tags.operator,
|
|
47
|
+
color: '#f47954'
|
|
48
|
+
},
|
|
49
|
+
// { tag: t.moduleKeyword, color: 'red' },
|
|
50
|
+
{
|
|
51
|
+
tag: [_highlight.tags.propertyName, _highlight.tags.typeName],
|
|
52
|
+
color: '#629ccd'
|
|
53
|
+
}, {
|
|
54
|
+
tag: [_highlight.tags.tagName, _highlight.tags.modifier],
|
|
55
|
+
color: '#E35F63'
|
|
56
|
+
}, {
|
|
57
|
+
tag: [_highlight.tags.number, _highlight.tags.definition(_highlight.tags.tagName), _highlight.tags.className, _highlight.tags.definition(_highlight.tags.variableName)],
|
|
58
|
+
color: '#fbac52'
|
|
59
|
+
}, {
|
|
60
|
+
tag: [_highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)],
|
|
61
|
+
color: '#E35F63'
|
|
62
|
+
}].concat((0, _toConsumableArray2["default"])(styles))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
var sublime = sublimeInit();
|
|
52
66
|
exports.sublime = sublime;
|
|
53
67
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"names": [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"sublimeInit",
|
|
5
|
+
"options",
|
|
6
6
|
"theme",
|
|
7
7
|
"settings",
|
|
8
|
+
"styles",
|
|
9
|
+
"createTheme",
|
|
8
10
|
"background",
|
|
9
11
|
"foreground",
|
|
10
12
|
"caret",
|
|
@@ -13,7 +15,6 @@
|
|
|
13
15
|
"gutterBackground",
|
|
14
16
|
"gutterForeground",
|
|
15
17
|
"lineHighlight",
|
|
16
|
-
"styles",
|
|
17
18
|
"tag",
|
|
18
19
|
"t",
|
|
19
20
|
"meta",
|
|
@@ -35,13 +36,14 @@
|
|
|
35
36
|
"className",
|
|
36
37
|
"atom",
|
|
37
38
|
"bool",
|
|
38
|
-
"special"
|
|
39
|
+
"special",
|
|
40
|
+
"sublime"
|
|
39
41
|
],
|
|
40
42
|
"sources": [
|
|
41
43
|
"../src/index.ts"
|
|
42
44
|
],
|
|
43
45
|
"sourcesContent": [
|
|
44
|
-
"import { tags as t } from '@lezer/highlight';\nimport { createTheme } from '@uiw/codemirror-themes';\n\nexport const
|
|
46
|
+
"import { tags as t } from '@lezer/highlight';\nimport { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';\n\nexport function sublimeInit(options?: CreateThemeOptions) {\n const { theme = 'dark', settings = {}, styles = [] } = options || {};\n return createTheme({\n theme: theme,\n settings: {\n background: '#303841',\n foreground: '#FFFFFF',\n caret: '#FBAC52',\n selection: '#4C5964',\n selectionMatch: '#3A546E',\n gutterBackground: '#303841',\n gutterForeground: '#FFFFFF70',\n lineHighlight: '#00000059',\n ...settings,\n },\n styles: [\n { tag: [t.meta, t.comment], color: '#A2A9B5' },\n { tag: [t.attributeName, t.keyword], color: '#B78FBA' },\n { tag: t.function(t.variableName), color: '#5AB0B0' },\n { tag: [t.string, t.regexp, t.attributeValue], color: '#99C592' },\n { tag: t.operator, color: '#f47954' },\n // { tag: t.moduleKeyword, color: 'red' },\n { tag: [t.propertyName, t.typeName], color: '#629ccd' },\n { tag: [t.tagName, t.modifier], color: '#E35F63' },\n { tag: [t.number, t.definition(t.tagName), t.className, t.definition(t.variableName)], color: '#fbac52' },\n { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#E35F63' },\n ...styles,\n ],\n });\n}\n\nexport const sublime = sublimeInit();\n"
|
|
45
47
|
],
|
|
46
|
-
"mappings": "
|
|
48
|
+
"mappings": ";;;;;;;;;;AAAA;AACA;AAEO,SAASA,WAAW,CAACC,OAA4B,EAAE;EACxD,WAAuDA,OAAO,IAAI,CAAC,CAAC;IAAA,kBAA5DC,KAAK;IAALA,KAAK,2BAAG,MAAM;IAAA,qBAAEC,QAAQ;IAARA,QAAQ,8BAAG,CAAC,CAAC;IAAA,mBAAEC,MAAM;IAANA,MAAM,4BAAG,EAAE;EAClD,OAAO,IAAAC,6BAAW,EAAC;IACjBH,KAAK,EAAEA,KAAK;IACZC,QAAQ;MACNG,UAAU,EAAE,SAAS;MACrBC,UAAU,EAAE,SAAS;MACrBC,KAAK,EAAE,SAAS;MAChBC,SAAS,EAAE,SAAS;MACpBC,cAAc,EAAE,SAAS;MACzBC,gBAAgB,EAAE,SAAS;MAC3BC,gBAAgB,EAAE,WAAW;MAC7BC,aAAa,EAAE;IAAW,GACvBV,QAAQ,CACZ;IACDC,MAAM,GACJ;MAAEU,GAAG,EAAE,CAACC,eAAC,CAACC,IAAI,EAAED,eAAC,CAACE,OAAO,CAAC;MAAEC,KAAK,EAAE;IAAU,CAAC,EAC9C;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACI,aAAa,EAAEJ,eAAC,CAACK,OAAO,CAAC;MAAEF,KAAK,EAAE;IAAU,CAAC,EACvD;MAAEJ,GAAG,EAAEC,eAAC,YAAS,CAACA,eAAC,CAACM,YAAY,CAAC;MAAEH,KAAK,EAAE;IAAU,CAAC,EACrD;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACO,MAAM,EAAEP,eAAC,CAACQ,MAAM,EAAER,eAAC,CAACS,cAAc,CAAC;MAAEN,KAAK,EAAE;IAAU,CAAC,EACjE;MAAEJ,GAAG,EAAEC,eAAC,CAACU,QAAQ;MAAEP,KAAK,EAAE;IAAU,CAAC;IACrC;IACA;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACW,YAAY,EAAEX,eAAC,CAACY,QAAQ,CAAC;MAAET,KAAK,EAAE;IAAU,CAAC,EACvD;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACa,OAAO,EAAEb,eAAC,CAACc,QAAQ,CAAC;MAAEX,KAAK,EAAE;IAAU,CAAC,EAClD;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACe,MAAM,EAAEf,eAAC,CAACgB,UAAU,CAAChB,eAAC,CAACa,OAAO,CAAC,EAAEb,eAAC,CAACiB,SAAS,EAAEjB,eAAC,CAACgB,UAAU,CAAChB,eAAC,CAACM,YAAY,CAAC,CAAC;MAAEH,KAAK,EAAE;IAAU,CAAC,EACzG;MAAEJ,GAAG,EAAE,CAACC,eAAC,CAACkB,IAAI,EAAElB,eAAC,CAACmB,IAAI,EAAEnB,eAAC,CAACoB,OAAO,CAACpB,eAAC,CAACM,YAAY,CAAC,CAAC;MAAEH,KAAK,EAAE;IAAU,CAAC,6CACnEd,MAAM;EAEb,CAAC,CAAC;AACJ;AAEO,IAAMgC,OAAO,GAAGpC,WAAW,EAAE;AAAC"
|
|
47
49
|
}
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,46 +1,55 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import { tags as t } from '@lezer/highlight';
|
|
2
3
|
import { createTheme } from '@uiw/codemirror-themes';
|
|
3
|
-
export
|
|
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
|
-
color: '
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
4
|
+
export function sublimeInit(options) {
|
|
5
|
+
var {
|
|
6
|
+
theme = 'dark',
|
|
7
|
+
settings = {},
|
|
8
|
+
styles = []
|
|
9
|
+
} = options || {};
|
|
10
|
+
return createTheme({
|
|
11
|
+
theme: theme,
|
|
12
|
+
settings: _extends({
|
|
13
|
+
background: '#303841',
|
|
14
|
+
foreground: '#FFFFFF',
|
|
15
|
+
caret: '#FBAC52',
|
|
16
|
+
selection: '#4C5964',
|
|
17
|
+
selectionMatch: '#3A546E',
|
|
18
|
+
gutterBackground: '#303841',
|
|
19
|
+
gutterForeground: '#FFFFFF70',
|
|
20
|
+
lineHighlight: '#00000059'
|
|
21
|
+
}, settings),
|
|
22
|
+
styles: [{
|
|
23
|
+
tag: [t.meta, t.comment],
|
|
24
|
+
color: '#A2A9B5'
|
|
25
|
+
}, {
|
|
26
|
+
tag: [t.attributeName, t.keyword],
|
|
27
|
+
color: '#B78FBA'
|
|
28
|
+
}, {
|
|
29
|
+
tag: t.function(t.variableName),
|
|
30
|
+
color: '#5AB0B0'
|
|
31
|
+
}, {
|
|
32
|
+
tag: [t.string, t.regexp, t.attributeValue],
|
|
33
|
+
color: '#99C592'
|
|
34
|
+
}, {
|
|
35
|
+
tag: t.operator,
|
|
36
|
+
color: '#f47954'
|
|
37
|
+
},
|
|
38
|
+
// { tag: t.moduleKeyword, color: 'red' },
|
|
39
|
+
{
|
|
40
|
+
tag: [t.propertyName, t.typeName],
|
|
41
|
+
color: '#629ccd'
|
|
42
|
+
}, {
|
|
43
|
+
tag: [t.tagName, t.modifier],
|
|
44
|
+
color: '#E35F63'
|
|
45
|
+
}, {
|
|
46
|
+
tag: [t.number, t.definition(t.tagName), t.className, t.definition(t.variableName)],
|
|
47
|
+
color: '#fbac52'
|
|
48
|
+
}, {
|
|
49
|
+
tag: [t.atom, t.bool, t.special(t.variableName)],
|
|
50
|
+
color: '#E35F63'
|
|
51
|
+
}, ...styles]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export var sublime = sublimeInit();
|
|
46
55
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
"tags",
|
|
5
5
|
"t",
|
|
6
6
|
"createTheme",
|
|
7
|
-
"
|
|
7
|
+
"sublimeInit",
|
|
8
|
+
"options",
|
|
8
9
|
"theme",
|
|
9
10
|
"settings",
|
|
11
|
+
"styles",
|
|
10
12
|
"background",
|
|
11
13
|
"foreground",
|
|
12
14
|
"caret",
|
|
@@ -15,7 +17,6 @@
|
|
|
15
17
|
"gutterBackground",
|
|
16
18
|
"gutterForeground",
|
|
17
19
|
"lineHighlight",
|
|
18
|
-
"styles",
|
|
19
20
|
"tag",
|
|
20
21
|
"meta",
|
|
21
22
|
"comment",
|
|
@@ -37,13 +38,14 @@
|
|
|
37
38
|
"className",
|
|
38
39
|
"atom",
|
|
39
40
|
"bool",
|
|
40
|
-
"special"
|
|
41
|
+
"special",
|
|
42
|
+
"sublime"
|
|
41
43
|
],
|
|
42
44
|
"sources": [
|
|
43
45
|
"../src/index.ts"
|
|
44
46
|
],
|
|
45
47
|
"sourcesContent": [
|
|
46
|
-
"import { tags as t } from '@lezer/highlight';\nimport { createTheme } from '@uiw/codemirror-themes';\n\nexport const
|
|
48
|
+
"import { tags as t } from '@lezer/highlight';\nimport { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';\n\nexport function sublimeInit(options?: CreateThemeOptions) {\n const { theme = 'dark', settings = {}, styles = [] } = options || {};\n return createTheme({\n theme: theme,\n settings: {\n background: '#303841',\n foreground: '#FFFFFF',\n caret: '#FBAC52',\n selection: '#4C5964',\n selectionMatch: '#3A546E',\n gutterBackground: '#303841',\n gutterForeground: '#FFFFFF70',\n lineHighlight: '#00000059',\n ...settings,\n },\n styles: [\n { tag: [t.meta, t.comment], color: '#A2A9B5' },\n { tag: [t.attributeName, t.keyword], color: '#B78FBA' },\n { tag: t.function(t.variableName), color: '#5AB0B0' },\n { tag: [t.string, t.regexp, t.attributeValue], color: '#99C592' },\n { tag: t.operator, color: '#f47954' },\n // { tag: t.moduleKeyword, color: 'red' },\n { tag: [t.propertyName, t.typeName], color: '#629ccd' },\n { tag: [t.tagName, t.modifier], color: '#E35F63' },\n { tag: [t.number, t.definition(t.tagName), t.className, t.definition(t.variableName)], color: '#fbac52' },\n { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#E35F63' },\n ...styles,\n ],\n });\n}\n\nexport const sublime = sublimeInit();\n"
|
|
47
49
|
],
|
|
48
|
-
"mappings": "AAAA,SAASA,IAAI,IAAIC,CAAC,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,
|
|
50
|
+
"mappings": ";AAAA,SAASA,IAAI,IAAIC,CAAC,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAA4B,wBAAwB;AAExE,OAAO,SAASC,WAAW,CAACC,OAA4B,EAAE;EACxD,IAAM;IAAEC,KAAK,GAAG,MAAM;IAAEC,QAAQ,GAAG,CAAC,CAAC;IAAEC,MAAM,GAAG;EAAG,CAAC,GAAGH,OAAO,IAAI,CAAC,CAAC;EACpE,OAAOF,WAAW,CAAC;IACjBG,KAAK,EAAEA,KAAK;IACZC,QAAQ;MACNE,UAAU,EAAE,SAAS;MACrBC,UAAU,EAAE,SAAS;MACrBC,KAAK,EAAE,SAAS;MAChBC,SAAS,EAAE,SAAS;MACpBC,cAAc,EAAE,SAAS;MACzBC,gBAAgB,EAAE,SAAS;MAC3BC,gBAAgB,EAAE,WAAW;MAC7BC,aAAa,EAAE;IAAW,GACvBT,QAAQ,CACZ;IACDC,MAAM,EAAE,CACN;MAAES,GAAG,EAAE,CAACf,CAAC,CAACgB,IAAI,EAAEhB,CAAC,CAACiB,OAAO,CAAC;MAAEC,KAAK,EAAE;IAAU,CAAC,EAC9C;MAAEH,GAAG,EAAE,CAACf,CAAC,CAACmB,aAAa,EAAEnB,CAAC,CAACoB,OAAO,CAAC;MAAEF,KAAK,EAAE;IAAU,CAAC,EACvD;MAAEH,GAAG,EAAEf,CAAC,CAACqB,QAAQ,CAACrB,CAAC,CAACsB,YAAY,CAAC;MAAEJ,KAAK,EAAE;IAAU,CAAC,EACrD;MAAEH,GAAG,EAAE,CAACf,CAAC,CAACuB,MAAM,EAAEvB,CAAC,CAACwB,MAAM,EAAExB,CAAC,CAACyB,cAAc,CAAC;MAAEP,KAAK,EAAE;IAAU,CAAC,EACjE;MAAEH,GAAG,EAAEf,CAAC,CAAC0B,QAAQ;MAAER,KAAK,EAAE;IAAU,CAAC;IACrC;IACA;MAAEH,GAAG,EAAE,CAACf,CAAC,CAAC2B,YAAY,EAAE3B,CAAC,CAAC4B,QAAQ,CAAC;MAAEV,KAAK,EAAE;IAAU,CAAC,EACvD;MAAEH,GAAG,EAAE,CAACf,CAAC,CAAC6B,OAAO,EAAE7B,CAAC,CAAC8B,QAAQ,CAAC;MAAEZ,KAAK,EAAE;IAAU,CAAC,EAClD;MAAEH,GAAG,EAAE,CAACf,CAAC,CAAC+B,MAAM,EAAE/B,CAAC,CAACgC,UAAU,CAAChC,CAAC,CAAC6B,OAAO,CAAC,EAAE7B,CAAC,CAACiC,SAAS,EAAEjC,CAAC,CAACgC,UAAU,CAAChC,CAAC,CAACsB,YAAY,CAAC,CAAC;MAAEJ,KAAK,EAAE;IAAU,CAAC,EACzG;MAAEH,GAAG,EAAE,CAACf,CAAC,CAACkC,IAAI,EAAElC,CAAC,CAACmC,IAAI,EAAEnC,CAAC,CAACoC,OAAO,CAACpC,CAAC,CAACsB,YAAY,CAAC,CAAC;MAAEJ,KAAK,EAAE;IAAU,CAAC,EACtE,GAAGZ,MAAM;EAEb,CAAC,CAAC;AACJ;AAEA,OAAO,IAAM+B,OAAO,GAAGnC,WAAW,EAAE"
|
|
49
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/codemirror-theme-sublime",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.1",
|
|
4
4
|
"description": "Theme sublime for CodeMirror.",
|
|
5
5
|
"homepage": "https://uiwjs.github.io/react-codemirror/#/theme/data/sublime",
|
|
6
6
|
"author": "kenny wong <wowohoo@qq.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"cjs"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@uiw/codemirror-themes": "4.
|
|
24
|
+
"@uiw/codemirror-themes": "4.18.1"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
27
27
|
"codemirror",
|
package/src/index.ts
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { tags as t } from '@lezer/highlight';
|
|
2
|
-
import { createTheme } from '@uiw/codemirror-themes';
|
|
2
|
+
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
theme
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
4
|
+
export function sublimeInit(options?: CreateThemeOptions) {
|
|
5
|
+
const { theme = 'dark', settings = {}, styles = [] } = options || {};
|
|
6
|
+
return createTheme({
|
|
7
|
+
theme: theme,
|
|
8
|
+
settings: {
|
|
9
|
+
background: '#303841',
|
|
10
|
+
foreground: '#FFFFFF',
|
|
11
|
+
caret: '#FBAC52',
|
|
12
|
+
selection: '#4C5964',
|
|
13
|
+
selectionMatch: '#3A546E',
|
|
14
|
+
gutterBackground: '#303841',
|
|
15
|
+
gutterForeground: '#FFFFFF70',
|
|
16
|
+
lineHighlight: '#00000059',
|
|
17
|
+
...settings,
|
|
18
|
+
},
|
|
19
|
+
styles: [
|
|
20
|
+
{ tag: [t.meta, t.comment], color: '#A2A9B5' },
|
|
21
|
+
{ tag: [t.attributeName, t.keyword], color: '#B78FBA' },
|
|
22
|
+
{ tag: t.function(t.variableName), color: '#5AB0B0' },
|
|
23
|
+
{ tag: [t.string, t.regexp, t.attributeValue], color: '#99C592' },
|
|
24
|
+
{ tag: t.operator, color: '#f47954' },
|
|
25
|
+
// { tag: t.moduleKeyword, color: 'red' },
|
|
26
|
+
{ tag: [t.propertyName, t.typeName], color: '#629ccd' },
|
|
27
|
+
{ tag: [t.tagName, t.modifier], color: '#E35F63' },
|
|
28
|
+
{ tag: [t.number, t.definition(t.tagName), t.className, t.definition(t.variableName)], color: '#fbac52' },
|
|
29
|
+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#E35F63' },
|
|
30
|
+
...styles,
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const sublime = sublimeInit();
|