react-codemirror-editor 0.1.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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +211 -0
  3. package/dist/core/diagnostics/index.d.ts +2 -0
  4. package/dist/core/diagnostics/index.d.ts.map +1 -0
  5. package/dist/core/diagnostics/index.js +1 -0
  6. package/dist/core/diagnostics/jsonDiagnostics.d.ts +4 -0
  7. package/dist/core/diagnostics/jsonDiagnostics.d.ts.map +1 -0
  8. package/dist/core/diagnostics/jsonDiagnostics.js +78 -0
  9. package/dist/core/editor/createEditor.d.ts +4 -0
  10. package/dist/core/editor/createEditor.d.ts.map +1 -0
  11. package/dist/core/editor/createEditor.js +26 -0
  12. package/dist/core/editor/editorController.d.ts +3 -0
  13. package/dist/core/editor/editorController.d.ts.map +1 -0
  14. package/dist/core/editor/editorController.js +24 -0
  15. package/dist/core/editor/index.d.ts +3 -0
  16. package/dist/core/editor/index.d.ts.map +1 -0
  17. package/dist/core/editor/index.js +2 -0
  18. package/dist/core/extensions/copy.d.ts +3 -0
  19. package/dist/core/extensions/copy.d.ts.map +1 -0
  20. package/dist/core/extensions/copy.js +34 -0
  21. package/dist/core/extensions/fold.d.ts +4 -0
  22. package/dist/core/extensions/fold.d.ts.map +1 -0
  23. package/dist/core/extensions/fold.js +11 -0
  24. package/dist/core/extensions/format.d.ts +3 -0
  25. package/dist/core/extensions/format.d.ts.map +1 -0
  26. package/dist/core/extensions/format.js +25 -0
  27. package/dist/core/extensions/index.d.ts +5 -0
  28. package/dist/core/extensions/index.d.ts.map +1 -0
  29. package/dist/core/extensions/index.js +4 -0
  30. package/dist/core/extensions/readOnly.d.ts +2 -0
  31. package/dist/core/extensions/readOnly.d.ts.map +1 -0
  32. package/dist/core/extensions/readOnly.js +4 -0
  33. package/dist/core/invariants/controlled.d.ts +3 -0
  34. package/dist/core/invariants/controlled.d.ts.map +1 -0
  35. package/dist/core/invariants/controlled.js +23 -0
  36. package/dist/core/invariants/index.d.ts +2 -0
  37. package/dist/core/invariants/index.d.ts.map +1 -0
  38. package/dist/core/invariants/index.js +1 -0
  39. package/dist/core/languages/buildExtensions.d.ts +4 -0
  40. package/dist/core/languages/buildExtensions.d.ts.map +1 -0
  41. package/dist/core/languages/buildExtensions.js +13 -0
  42. package/dist/core/languages/index.d.ts +3 -0
  43. package/dist/core/languages/index.d.ts.map +1 -0
  44. package/dist/core/languages/index.js +2 -0
  45. package/dist/core/languages/json.d.ts +3 -0
  46. package/dist/core/languages/json.d.ts.map +1 -0
  47. package/dist/core/languages/json.js +4 -0
  48. package/dist/core/themes/dark/barf.d.ts +9 -0
  49. package/dist/core/themes/dark/barf.d.ts.map +1 -0
  50. package/dist/core/themes/dark/barf.js +84 -0
  51. package/dist/core/themes/dark/base.d.ts +4 -0
  52. package/dist/core/themes/dark/base.d.ts.map +1 -0
  53. package/dist/core/themes/dark/base.js +34 -0
  54. package/dist/core/themes/dark/cobalt.d.ts +9 -0
  55. package/dist/core/themes/dark/cobalt.d.ts.map +1 -0
  56. package/dist/core/themes/dark/cobalt.js +91 -0
  57. package/dist/core/themes/dark/cool-glow.d.ts +9 -0
  58. package/dist/core/themes/dark/cool-glow.d.ts.map +1 -0
  59. package/dist/core/themes/dark/cool-glow.js +84 -0
  60. package/dist/core/themes/dark/dracula.d.ts +9 -0
  61. package/dist/core/themes/dark/dracula.d.ts.map +1 -0
  62. package/dist/core/themes/dark/dracula.js +66 -0
  63. package/dist/core/themes/dark/index.d.ts +3 -0
  64. package/dist/core/themes/dark/index.d.ts.map +1 -0
  65. package/dist/core/themes/dark/index.js +16 -0
  66. package/dist/core/themes/index.d.ts +4 -0
  67. package/dist/core/themes/index.d.ts.map +1 -0
  68. package/dist/core/themes/index.js +9 -0
  69. package/dist/core/themes/light/ayu.d.ts +9 -0
  70. package/dist/core/themes/light/ayu.d.ts.map +1 -0
  71. package/dist/core/themes/light/ayu.js +60 -0
  72. package/dist/core/themes/light/base.d.ts +4 -0
  73. package/dist/core/themes/light/base.d.ts.map +1 -0
  74. package/dist/core/themes/light/base.js +34 -0
  75. package/dist/core/themes/light/clouds.d.ts +9 -0
  76. package/dist/core/themes/light/clouds.d.ts.map +1 -0
  77. package/dist/core/themes/light/clouds.js +46 -0
  78. package/dist/core/themes/light/espresso.d.ts +9 -0
  79. package/dist/core/themes/light/espresso.d.ts.map +1 -0
  80. package/dist/core/themes/light/espresso.js +62 -0
  81. package/dist/core/themes/light/index.d.ts +3 -0
  82. package/dist/core/themes/light/index.d.ts.map +1 -0
  83. package/dist/core/themes/light/index.js +34 -0
  84. package/dist/core/themes/light/noctis-lilac.d.ts +9 -0
  85. package/dist/core/themes/light/noctis-lilac.d.ts.map +1 -0
  86. package/dist/core/themes/light/noctis-lilac.js +76 -0
  87. package/dist/core/themes/light/rose-pine-dawn.d.ts +9 -0
  88. package/dist/core/themes/light/rose-pine-dawn.d.ts.map +1 -0
  89. package/dist/core/themes/light/rose-pine-dawn.js +46 -0
  90. package/dist/core/themes/light/smoothy.d.ts +9 -0
  91. package/dist/core/themes/light/smoothy.d.ts.map +1 -0
  92. package/dist/core/themes/light/smoothy.js +67 -0
  93. package/dist/core/themes/light/tomorrow.d.ts +9 -0
  94. package/dist/core/themes/light/tomorrow.d.ts.map +1 -0
  95. package/dist/core/themes/light/tomorrow.js +63 -0
  96. package/dist/index.d.ts +3 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +1 -0
  99. package/dist/types/editor.d.ts +64 -0
  100. package/dist/types/editor.d.ts.map +1 -0
  101. package/dist/types/editor.js +1 -0
  102. package/dist/types/index.d.ts +2 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/types/index.js +1 -0
  105. package/dist/ui/CodeEditor.d.ts +3 -0
  106. package/dist/ui/CodeEditor.d.ts.map +1 -0
  107. package/dist/ui/CodeEditor.js +21 -0
  108. package/dist/ui/EditorContainer.d.ts +3 -0
  109. package/dist/ui/EditorContainer.d.ts.map +1 -0
  110. package/dist/ui/EditorContainer.js +41 -0
  111. package/dist/ui/index.d.ts +3 -0
  112. package/dist/ui/index.d.ts.map +1 -0
  113. package/dist/ui/index.js +2 -0
  114. package/package.json +53 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barf.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/barf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,aAAa,uCAyBzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBAoD5B,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const barfDarkTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#15191EFA',
12
+ color: '#EEF2F7',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#C4C4C4',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#C4C4C4',
19
+ },
20
+ '.cm-selectionBackground, ::selection': {
21
+ backgroundColor: '#90B2D557',
22
+ },
23
+ '.cm-activeLine': {
24
+ backgroundColor: '#57575712',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#15191EFA',
28
+ color: '#aaaaaa95',
29
+ border: 'none',
30
+ },
31
+ }, { dark: true });
32
+ export const barfDarkHighlight = HighlightStyle.define([
33
+ {
34
+ tag: tags.comment,
35
+ color: '#6E6E6E',
36
+ },
37
+ {
38
+ tag: [tags.string, tags.regexp, tags.special(tags.brace)],
39
+ color: '#5C81B3',
40
+ },
41
+ {
42
+ tag: tags.number,
43
+ color: '#C1E1B8',
44
+ },
45
+ {
46
+ tag: tags.bool,
47
+ color: '#53667D',
48
+ },
49
+ {
50
+ tag: [
51
+ tags.definitionKeyword,
52
+ tags.modifier,
53
+ tags.function(tags.propertyName),
54
+ ],
55
+ color: '#A3D295',
56
+ fontWeight: 'bold',
57
+ },
58
+ {
59
+ tag: [
60
+ tags.keyword,
61
+ tags.moduleKeyword,
62
+ tags.operatorKeyword,
63
+ tags.operator,
64
+ ],
65
+ color: '#697A8E',
66
+ fontWeight: 'bold',
67
+ },
68
+ {
69
+ tag: [tags.variableName, tags.attributeName],
70
+ color: '#708E67',
71
+ },
72
+ {
73
+ tag: [
74
+ tags.function(tags.variableName),
75
+ tags.definition(tags.propertyName),
76
+ tags.derefOperator,
77
+ ],
78
+ color: '#ffffff',
79
+ },
80
+ {
81
+ tag: tags.tagName,
82
+ color: '#A3D295',
83
+ },
84
+ ]);
@@ -0,0 +1,4 @@
1
+ import { HighlightStyle } from '@codemirror/language';
2
+ export declare const darkTheme: import("@codemirror/state").Extension;
3
+ export declare const darkHighlight: HighlightStyle;
4
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,SAAS,uCAyBrB,CAAC;AAEF,eAAO,MAAM,aAAa,gBAOxB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+ export const darkTheme = EditorView.theme({
5
+ '&': {
6
+ backgroundColor: '#0f172a',
7
+ color: '#e5e7eb',
8
+ },
9
+ '.cm-content': {
10
+ caretColor: '#38bdf8',
11
+ },
12
+ '.cm-cursor, .cm-dropCursor': {
13
+ borderLeftColor: '#38bdf8',
14
+ },
15
+ '.cm-activeLine': {
16
+ backgroundColor: '#1e293b',
17
+ },
18
+ '.cm-selectionBackground, ::selection': {
19
+ backgroundColor: '#334155',
20
+ },
21
+ '.cm-gutters': {
22
+ backgroundColor: '#020617',
23
+ color: '#64748b',
24
+ border: 'none',
25
+ },
26
+ }, { dark: true });
27
+ export const darkHighlight = HighlightStyle.define([
28
+ { tag: tags.keyword, color: '#c084fc' },
29
+ { tag: tags.string, color: '#4ade80' },
30
+ { tag: tags.number, color: '#38bdf8' },
31
+ { tag: tags.comment, color: '#64748b', fontStyle: 'italic' },
32
+ { tag: tags.function(tags.variableName), color: '#2dd4bf' },
33
+ { tag: tags.typeName, color: '#f472b6' },
34
+ ]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const cobaltDarkTheme: import("@codemirror/state").Extension;
8
+ export declare const cobaltDarkHighlight: HighlightStyle;
9
+ //# sourceMappingURL=cobalt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cobalt.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/cobalt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,eAAe,uCAyB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBA2D9B,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const cobaltDarkTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#00254b',
12
+ color: '#FFFFFF',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#FFFFFF',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#FFFFFF',
19
+ },
20
+ '.cm-selectionBackground, ::selection': {
21
+ backgroundColor: '#B36539BF',
22
+ },
23
+ '.cm-activeLine': {
24
+ backgroundColor: '#00000059',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#00254b',
28
+ color: '#FFFFFF70',
29
+ border: 'none',
30
+ },
31
+ }, { dark: true });
32
+ export const cobaltDarkHighlight = HighlightStyle.define([
33
+ {
34
+ tag: tags.comment,
35
+ color: '#0088FF',
36
+ },
37
+ {
38
+ tag: tags.string,
39
+ color: '#3AD900',
40
+ },
41
+ {
42
+ tag: tags.regexp,
43
+ color: '#80FFC2',
44
+ },
45
+ {
46
+ tag: [tags.number, tags.bool, tags.null],
47
+ color: '#FF628C',
48
+ },
49
+ {
50
+ tag: [tags.definitionKeyword, tags.modifier],
51
+ color: '#FFEE80',
52
+ },
53
+ {
54
+ tag: tags.variableName,
55
+ color: '#CCCCCC',
56
+ },
57
+ {
58
+ tag: tags.self,
59
+ color: '#FF80E1',
60
+ },
61
+ {
62
+ tag: [
63
+ tags.className,
64
+ tags.definition(tags.propertyName),
65
+ tags.function(tags.variableName),
66
+ tags.definition(tags.typeName),
67
+ tags.labelName,
68
+ ],
69
+ color: '#FFDD00',
70
+ },
71
+ {
72
+ tag: [tags.keyword, tags.operator],
73
+ color: '#FF9D00',
74
+ },
75
+ {
76
+ tag: [tags.propertyName, tags.typeName],
77
+ color: '#80FFBB',
78
+ },
79
+ {
80
+ tag: tags.special(tags.brace),
81
+ color: '#EDEF7D',
82
+ },
83
+ {
84
+ tag: tags.attributeName,
85
+ color: '#9EFFFF',
86
+ },
87
+ {
88
+ tag: tags.derefOperator,
89
+ color: '#ffffff',
90
+ },
91
+ ]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const coolGlowDarkTheme: import("@codemirror/state").Extension;
8
+ export declare const coolGlowDarkHighlight: HighlightStyle;
9
+ //# sourceMappingURL=cool-glow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cool-glow.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/cool-glow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,iBAAiB,uCAyB7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gBAoDhC,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const coolGlowDarkTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#060521',
12
+ color: '#E0E0E0',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#FFFFFFA6',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#FFFFFFA6',
19
+ },
20
+ '.cm-selectionBackground, ::selection': {
21
+ backgroundColor: '#122BBB',
22
+ },
23
+ '.cm-activeLine': {
24
+ backgroundColor: '#FFFFFF0F',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#060521',
28
+ color: '#E0E0E090',
29
+ border: 'none',
30
+ },
31
+ }, { dark: true });
32
+ export const coolGlowDarkHighlight = HighlightStyle.define([
33
+ {
34
+ tag: tags.comment,
35
+ color: '#AEAEAE',
36
+ },
37
+ {
38
+ tag: [tags.string, tags.special(tags.brace), tags.regexp],
39
+ color: '#8DFF8E',
40
+ },
41
+ {
42
+ tag: [
43
+ tags.className,
44
+ tags.definition(tags.propertyName),
45
+ tags.function(tags.variableName),
46
+ tags.function(tags.definition(tags.variableName)),
47
+ tags.definition(tags.typeName),
48
+ ],
49
+ color: '#A3EBFF',
50
+ },
51
+ {
52
+ tag: [tags.number, tags.bool, tags.null],
53
+ color: '#62E9BD',
54
+ },
55
+ {
56
+ tag: [tags.keyword, tags.operator],
57
+ color: '#2BF1DC',
58
+ },
59
+ {
60
+ tag: [tags.definitionKeyword, tags.modifier],
61
+ color: '#F8FBB1',
62
+ },
63
+ {
64
+ tag: [tags.variableName, tags.self],
65
+ color: '#B683CA',
66
+ },
67
+ {
68
+ tag: [
69
+ tags.angleBracket,
70
+ tags.tagName,
71
+ tags.typeName,
72
+ tags.propertyName,
73
+ ],
74
+ color: '#60A4F1',
75
+ },
76
+ {
77
+ tag: tags.derefOperator,
78
+ color: '#E0E0E0',
79
+ },
80
+ {
81
+ tag: tags.attributeName,
82
+ color: '#7BACCA',
83
+ },
84
+ ]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const draculaTheme: import("@codemirror/state").Extension;
8
+ export declare const draculaHighlight: HighlightStyle;
9
+ //# sourceMappingURL=dracula.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dracula.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/dracula.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,YAAY,uCAyBxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAkC3B,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const draculaTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#2d2f3f',
12
+ color: '#f8f8f2',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#f8f8f0',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#f8f8f0',
19
+ },
20
+ '.cm-selectionBackground, ::selection': {
21
+ backgroundColor: '#44475a',
22
+ },
23
+ '.cm-activeLine': {
24
+ backgroundColor: '#44475a',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#282a36',
28
+ color: 'rgb(144, 145, 148)',
29
+ border: 'none',
30
+ },
31
+ }, { dark: true });
32
+ export const draculaHighlight = HighlightStyle.define([
33
+ {
34
+ tag: tags.comment,
35
+ color: '#6272a4',
36
+ },
37
+ {
38
+ tag: [tags.string, tags.special(tags.brace)],
39
+ color: '#f1fa8c',
40
+ },
41
+ {
42
+ tag: [tags.number, tags.self, tags.bool, tags.null],
43
+ color: '#bd93f9',
44
+ },
45
+ {
46
+ tag: [tags.keyword, tags.operator],
47
+ color: '#ff79c6',
48
+ },
49
+ {
50
+ tag: [tags.definitionKeyword, tags.typeName],
51
+ color: '#8be9fd',
52
+ },
53
+ {
54
+ tag: tags.definition(tags.typeName),
55
+ color: '#f8f8f2',
56
+ },
57
+ {
58
+ tag: [
59
+ tags.className,
60
+ tags.definition(tags.propertyName),
61
+ tags.function(tags.variableName),
62
+ tags.attributeName,
63
+ ],
64
+ color: '#50fa7b',
65
+ },
66
+ ]);
@@ -0,0 +1,3 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ export declare const darkThemes: Record<string, Extension>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/dark/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASnD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAShD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { syntaxHighlighting } from '@codemirror/language';
2
+ import { darkTheme, darkHighlight } from './base';
3
+ import { barfDarkTheme, barfDarkHighlight } from './barf';
4
+ import { cobaltDarkTheme, cobaltDarkHighlight } from './cobalt';
5
+ import { coolGlowDarkTheme, coolGlowDarkHighlight } from './cool-glow';
6
+ import { draculaTheme, draculaHighlight } from './dracula';
7
+ export const darkThemes = {
8
+ dark: [darkTheme, syntaxHighlighting(darkHighlight)],
9
+ barf_dark: [barfDarkTheme, syntaxHighlighting(barfDarkHighlight)],
10
+ cobalt_dark: [cobaltDarkTheme, syntaxHighlighting(cobaltDarkHighlight)],
11
+ cool_glow_dark: [
12
+ coolGlowDarkTheme,
13
+ syntaxHighlighting(coolGlowDarkHighlight),
14
+ ],
15
+ dracula_dark: [draculaTheme, syntaxHighlighting(draculaHighlight)],
16
+ };
@@ -0,0 +1,4 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ import { ThemeName } from '../../types';
3
+ export declare const getThemeExtension: (theme?: ThemeName) => Extension;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/themes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,eAAO,MAAM,iBAAiB,WAAW,SAAS,cAEjD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { lightThemes } from './light';
2
+ import { darkThemes } from './dark';
3
+ const themeRegistry = {
4
+ ...lightThemes,
5
+ ...darkThemes,
6
+ };
7
+ export const getThemeExtension = (theme = 'light') => {
8
+ return themeRegistry[theme];
9
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const ayuLightTheme: import("@codemirror/state").Extension;
8
+ export declare const ayuLightHighlight: HighlightStyle;
9
+ //# sourceMappingURL=ayu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ayu.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/light/ayu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,aAAa,uCAyBzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBA4B5B,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const ayuLightTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#fcfcfc',
12
+ color: '#5c6166',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#ffaa33',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#ffaa33',
19
+ },
20
+ '.cm-activeLine': {
21
+ backgroundColor: '#8a91991a',
22
+ },
23
+ '.cm-selectionBackground, ::selection': {
24
+ backgroundColor: '#036dd626',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#fcfcfc',
28
+ color: '#8a919966',
29
+ border: 'none',
30
+ },
31
+ }, { dark: false });
32
+ export const ayuLightHighlight = HighlightStyle.define([
33
+ { tag: tags.comment, color: '#787b8099' },
34
+ { tag: tags.string, color: '#86b300' },
35
+ { tag: tags.regexp, color: '#4cbf99' },
36
+ { tag: [tags.number, tags.bool, tags.null], color: '#ffaa33' },
37
+ { tag: tags.variableName, color: '#5c6166' },
38
+ { tag: [tags.definitionKeyword, tags.modifier], color: '#fa8d3e' },
39
+ { tag: [tags.keyword, tags.special(tags.brace)], color: '#fa8d3e' },
40
+ { tag: tags.operator, color: '#ed9366' },
41
+ { tag: tags.separator, color: '#5c6166b3' },
42
+ { tag: tags.punctuation, color: '#5c6166' },
43
+ {
44
+ tag: [
45
+ tags.definition(tags.propertyName),
46
+ tags.function(tags.variableName),
47
+ ],
48
+ color: '#f2ae49',
49
+ },
50
+ {
51
+ tag: [tags.className, tags.definition(tags.typeName)],
52
+ color: '#22a4e6',
53
+ },
54
+ {
55
+ tag: [tags.tagName, tags.typeName, tags.self, tags.labelName],
56
+ color: '#55b4d4',
57
+ },
58
+ { tag: tags.angleBracket, color: '#55b4d480' },
59
+ { tag: tags.attributeName, color: '#f2ae49' },
60
+ ]);
@@ -0,0 +1,4 @@
1
+ import { HighlightStyle } from '@codemirror/language';
2
+ export declare const lightTheme: import("@codemirror/state").Extension;
3
+ export declare const lightHighlight: HighlightStyle;
4
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/light/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,UAAU,uCAyBtB,CAAC;AAEF,eAAO,MAAM,cAAc,gBAOzB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+ export const lightTheme = EditorView.theme({
5
+ '&': {
6
+ backgroundColor: '#fafafa',
7
+ color: '#1f2937',
8
+ },
9
+ '.cm-content': {
10
+ caretColor: '#2563eb',
11
+ },
12
+ '.cm-cursor, .cm-dropCursor': {
13
+ borderLeftColor: '#2563eb',
14
+ },
15
+ '.cm-activeLine': {
16
+ backgroundColor: '#e5e7eb55',
17
+ },
18
+ '.cm-selectionBackground, ::selection': {
19
+ backgroundColor: '#bfdbfe',
20
+ },
21
+ '.cm-gutters': {
22
+ backgroundColor: '#f3f4f6',
23
+ color: '#6b7280',
24
+ border: 'none',
25
+ },
26
+ }, { dark: false });
27
+ export const lightHighlight = HighlightStyle.define([
28
+ { tag: tags.keyword, color: '#7c3aed' },
29
+ { tag: tags.string, color: '#059669' },
30
+ { tag: tags.number, color: '#2563eb' },
31
+ { tag: tags.comment, color: '#9ca3af', fontStyle: 'italic' },
32
+ { tag: tags.function(tags.variableName), color: '#0f766e' },
33
+ { tag: tags.typeName, color: '#9333ea' },
34
+ ]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const cloudsLightTheme: import("@codemirror/state").Extension;
8
+ export declare const cloudsLightHighlight: HighlightStyle;
9
+ //# sourceMappingURL=clouds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clouds.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/light/clouds.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,uCAyB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBAe/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { EditorView } from '@codemirror/view';
7
+ import { HighlightStyle } from '@codemirror/language';
8
+ import { tags } from '@lezer/highlight';
9
+ export const cloudsLightTheme = EditorView.theme({
10
+ '&': {
11
+ backgroundColor: '#ffffff',
12
+ color: '#000000',
13
+ },
14
+ '.cm-content': {
15
+ caretColor: '#000000',
16
+ },
17
+ '.cm-cursor, .cm-dropCursor': {
18
+ borderLeftColor: '#000000',
19
+ },
20
+ '.cm-activeLine': {
21
+ backgroundColor: '#FFFBD1',
22
+ },
23
+ '.cm-selectionBackground, ::selection': {
24
+ backgroundColor: '#BDD5FC',
25
+ },
26
+ '.cm-gutters': {
27
+ backgroundColor: '#ffffff',
28
+ color: '#00000070',
29
+ border: 'none',
30
+ },
31
+ }, { dark: false });
32
+ export const cloudsLightHighlight = HighlightStyle.define([
33
+ { tag: tags.comment, color: '#BCC8BA' },
34
+ {
35
+ tag: [tags.string, tags.special(tags.brace), tags.regexp],
36
+ color: '#5D90CD',
37
+ },
38
+ { tag: [tags.number, tags.bool, tags.null], color: '#46A609' },
39
+ { tag: tags.keyword, color: '#AF956F' },
40
+ { tag: [tags.definitionKeyword, tags.modifier], color: '#C52727' },
41
+ {
42
+ tag: [tags.angleBracket, tags.tagName, tags.attributeName],
43
+ color: '#606060',
44
+ },
45
+ { tag: tags.self, color: '#000000' },
46
+ ]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Theme inspired by Thememirror
3
+ * https://github.com/vadimdemedes/thememirror
4
+ * MIT License
5
+ */
6
+ import { HighlightStyle } from '@codemirror/language';
7
+ export declare const espressoLightTheme: import("@codemirror/state").Extension;
8
+ export declare const espressoLightHighlight: HighlightStyle;
9
+ //# sourceMappingURL=espresso.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"espresso.d.ts","sourceRoot":"","sources":["../../../../src/core/themes/light/espresso.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,eAAO,MAAM,kBAAkB,uCAyB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,gBA8BjC,CAAC"}