@fsegurai/codemirror-theme-android-studio 6.0.1-alpha.0

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 ADDED
@@ -0,0 +1,28 @@
1
+ <!-- NOTE: README.md is generated from src/README.md -->
2
+
3
+ # @fsegurai/codemirror-theme-android-studio-theme [![NPM version](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-android-studio-theme.svg)](https://www.npmjs.org/package/@fsegurai/codemirror-theme-android-studio-theme)
4
+
5
+ [ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/codemirror.next/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/theme-one-dark/blob/main/CHANGELOG.md) ]
6
+
7
+ This package implements the Android Studio theme for the
8
+ [CodeMirror](https://codemirror.net/6/) code editor.
9
+
10
+ The [project page](https://codemirror.net/6/) has more information, a
11
+ number of [examples](https://codemirror.net/6/examples/) and the
12
+ [documentation](https://codemirror.net/6/docs/).
13
+
14
+ This code is released under an
15
+ [MIT license](https://github.com/fsegurai/cm6-themes/tree/main/LICENSE).
16
+
17
+ We aim to be an inclusive, welcoming community. To make that explicit,
18
+ we have a [code of
19
+ conduct](http://contributor-covenant.org/version/1/1/0/) that applies
20
+ to communication around the project.
21
+
22
+ ## API Reference
23
+
24
+ @androidStudio
25
+
26
+ @androidStudioTheme
27
+
28
+ @androidStudioHighlightStyle
package/dist/index.cjs ADDED
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ var view = require('@codemirror/view');
4
+ var language = require('@codemirror/language');
5
+ var highlight = require('@lezer/highlight');
6
+
7
+ // Android Studio theme colors
8
+ const base00 = '#282b2e', // Background
9
+ base01 = '#a9b7c6', // Foreground
10
+ base02 = '#4e5254', // Selection
11
+ base03 = '#7f85891f', // Line highlight
12
+ base04 = '#00FF00', // Caret
13
+ base05 = '#cc7832', // Keyword, Deleted, ClassName
14
+ base06 = '#6897bb', // Number, Literal, DerefOperator
15
+ base07 = '#629755', // Link, VariableName
16
+ base08 = 'grey', // Comment, Quote
17
+ base09 = '#bbb529', // Meta, DocumentMeta
18
+ base0A = '#6a8759', // String, PropertyName, AttributeValue
19
+ base0B = '#ffc66d', // Heading, TypeName
20
+ base0C = '#a9b7c6'; // AttributeName
21
+ // Define the editor theme styles for Android Studio.
22
+ const androidStudioTheme = view.EditorView.theme({
23
+ '&': {
24
+ color: base01,
25
+ backgroundColor: base00
26
+ },
27
+ '.cm-content': {
28
+ caretColor: base04
29
+ },
30
+ '&.cm-focused .cm-cursor': {
31
+ borderLeftColor: base04
32
+ },
33
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
34
+ backgroundColor: base02
35
+ },
36
+ '.cm-activeLine': {
37
+ backgroundColor: base03
38
+ },
39
+ '.cm-gutters': {
40
+ backgroundColor: base00,
41
+ color: base01
42
+ },
43
+ '.cm-tooltip': {
44
+ backgroundColor: base01
45
+ }
46
+ }, { dark: true });
47
+ // Define the highlighting style for code in the Android Studio theme.
48
+ const androidStudioHighlightStyle = language.HighlightStyle.define([
49
+ { tag: [highlight.tags.keyword, highlight.tags.deleted, highlight.tags.className], color: base05 },
50
+ { tag: [highlight.tags.number, highlight.tags.literal, highlight.tags.derefOperator], color: base06 },
51
+ { tag: [highlight.tags.link, highlight.tags.variableName], color: base07 },
52
+ { tag: [highlight.tags.comment, highlight.tags.quote], color: base08 },
53
+ { tag: [highlight.tags.meta, highlight.tags.documentMeta], color: base09 },
54
+ { tag: [highlight.tags.string, highlight.tags.propertyName, highlight.tags.attributeValue], color: base0A },
55
+ { tag: [highlight.tags.heading, highlight.tags.typeName], color: base0B },
56
+ { tag: [highlight.tags.attributeName], color: base0C },
57
+ { tag: highlight.tags.emphasis, fontStyle: 'italic' }
58
+ ]);
59
+ // Extension to enable the Android Studio theme (both the editor theme and the highlight style).
60
+ const androidStudio = [
61
+ androidStudioTheme,
62
+ language.syntaxHighlighting(androidStudioHighlightStyle)
63
+ ];
64
+
65
+ exports.androidStudio = androidStudio;
66
+ exports.androidStudioHighlightStyle = androidStudioHighlightStyle;
67
+ exports.androidStudioTheme = androidStudioTheme;
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const androidStudioTheme: Extension;
5
+ declare const androidStudioHighlightStyle: HighlightStyle;
6
+ declare const androidStudio: Extension;
7
+
8
+ export { androidStudio, androidStudioHighlightStyle, androidStudioTheme };
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const androidStudioTheme: Extension;
5
+ declare const androidStudioHighlightStyle: HighlightStyle;
6
+ declare const androidStudio: Extension;
7
+
8
+ export { androidStudio, androidStudioHighlightStyle, androidStudioTheme };
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+
5
+ // Android Studio theme colors
6
+ const base00 = '#282b2e', // Background
7
+ base01 = '#a9b7c6', // Foreground
8
+ base02 = '#4e5254', // Selection
9
+ base03 = '#7f85891f', // Line highlight
10
+ base04 = '#00FF00', // Caret
11
+ base05 = '#cc7832', // Keyword, Deleted, ClassName
12
+ base06 = '#6897bb', // Number, Literal, DerefOperator
13
+ base07 = '#629755', // Link, VariableName
14
+ base08 = 'grey', // Comment, Quote
15
+ base09 = '#bbb529', // Meta, DocumentMeta
16
+ base0A = '#6a8759', // String, PropertyName, AttributeValue
17
+ base0B = '#ffc66d', // Heading, TypeName
18
+ base0C = '#a9b7c6'; // AttributeName
19
+ // Define the editor theme styles for Android Studio.
20
+ const androidStudioTheme = /*@__PURE__*/EditorView.theme({
21
+ '&': {
22
+ color: base01,
23
+ backgroundColor: base00
24
+ },
25
+ '.cm-content': {
26
+ caretColor: base04
27
+ },
28
+ '&.cm-focused .cm-cursor': {
29
+ borderLeftColor: base04
30
+ },
31
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
32
+ backgroundColor: base02
33
+ },
34
+ '.cm-activeLine': {
35
+ backgroundColor: base03
36
+ },
37
+ '.cm-gutters': {
38
+ backgroundColor: base00,
39
+ color: base01
40
+ },
41
+ '.cm-tooltip': {
42
+ backgroundColor: base01
43
+ }
44
+ }, { dark: true });
45
+ // Define the highlighting style for code in the Android Studio theme.
46
+ const androidStudioHighlightStyle = /*@__PURE__*/HighlightStyle.define([
47
+ { tag: [tags.keyword, tags.deleted, tags.className], color: base05 },
48
+ { tag: [tags.number, tags.literal, tags.derefOperator], color: base06 },
49
+ { tag: [tags.link, tags.variableName], color: base07 },
50
+ { tag: [tags.comment, tags.quote], color: base08 },
51
+ { tag: [tags.meta, tags.documentMeta], color: base09 },
52
+ { tag: [tags.string, tags.propertyName, tags.attributeValue], color: base0A },
53
+ { tag: [tags.heading, tags.typeName], color: base0B },
54
+ { tag: [tags.attributeName], color: base0C },
55
+ { tag: tags.emphasis, fontStyle: 'italic' }
56
+ ]);
57
+ // Extension to enable the Android Studio theme (both the editor theme and the highlight style).
58
+ const androidStudio = [
59
+ androidStudioTheme,
60
+ /*@__PURE__*/syntaxHighlighting(androidStudioHighlightStyle)
61
+ ];
62
+
63
+ export { androidStudio, androidStudioHighlightStyle, androidStudioTheme };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@fsegurai/codemirror-theme-android-studio",
3
+ "description": "Android Studio theme for the CodeMirror code editor",
4
+ "version": "6.0.1-alpha.0",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "exports": {
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs"
10
+ },
11
+ "types": "dist/index.d.ts",
12
+ "module": "dist/index.js",
13
+ "sideEffects": false,
14
+ "scripts": {
15
+ "test": "cm-runtests",
16
+ "prepare": "cm-buildhelper src/index.ts"
17
+ },
18
+ "keywords": [
19
+ "editor",
20
+ "code",
21
+ "codemirror"
22
+ ],
23
+ "author": {
24
+ "name": "Fabián Segura",
25
+ "url": "https://www.fsegurai.com/"
26
+ },
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/fsegurai/codemirror-themes.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/fsegurai/codemirror-themes/issues"
34
+ },
35
+ "homepage": "https://github.com/fsegurai/codemirror-themes#readme",
36
+ "peerDependencies": {
37
+ "@lezer/highlight": "^1.0.0",
38
+ "@codemirror/language": "^6.0.0",
39
+ "@codemirror/state": "^6.0.0",
40
+ "@codemirror/view": "^6.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@codemirror/buildhelper": "^1.0.1"
44
+ }
45
+ }