@pyreon/code 0.11.4 → 0.11.6

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/src/themes.ts CHANGED
@@ -1,38 +1,38 @@
1
- import type { Extension } from "@codemirror/state"
2
- import { EditorView } from "@codemirror/view"
3
- import type { EditorTheme } from "./types"
1
+ import type { Extension } from '@codemirror/state'
2
+ import { EditorView } from '@codemirror/view'
3
+ import type { EditorTheme } from './types'
4
4
 
5
5
  /**
6
6
  * Light theme — clean, minimal.
7
7
  */
8
8
  export const lightTheme: Extension = EditorView.theme({
9
- "&": {
10
- backgroundColor: "#ffffff",
11
- color: "#1e293b",
9
+ '&': {
10
+ backgroundColor: '#ffffff',
11
+ color: '#1e293b',
12
12
  },
13
- ".cm-content": {
14
- caretColor: "#1e293b",
13
+ '.cm-content': {
14
+ caretColor: '#1e293b',
15
15
  },
16
- ".cm-cursor": {
17
- borderLeftColor: "#1e293b",
16
+ '.cm-cursor': {
17
+ borderLeftColor: '#1e293b',
18
18
  },
19
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": {
20
- backgroundColor: "#dbeafe",
19
+ '&.cm-focused .cm-selectionBackground, .cm-selectionBackground': {
20
+ backgroundColor: '#dbeafe',
21
21
  },
22
- ".cm-gutters": {
23
- backgroundColor: "#f8fafc",
24
- color: "#94a3b8",
25
- borderRight: "1px solid #e2e8f0",
22
+ '.cm-gutters': {
23
+ backgroundColor: '#f8fafc',
24
+ color: '#94a3b8',
25
+ borderRight: '1px solid #e2e8f0',
26
26
  },
27
- ".cm-activeLineGutter": {
28
- backgroundColor: "#f1f5f9",
29
- color: "#475569",
27
+ '.cm-activeLineGutter': {
28
+ backgroundColor: '#f1f5f9',
29
+ color: '#475569',
30
30
  },
31
- ".cm-activeLine": {
32
- backgroundColor: "#f8fafc",
31
+ '.cm-activeLine': {
32
+ backgroundColor: '#f8fafc',
33
33
  },
34
- ".cm-foldGutter": {
35
- color: "#94a3b8",
34
+ '.cm-foldGutter': {
35
+ color: '#94a3b8',
36
36
  },
37
37
  })
38
38
 
@@ -41,37 +41,37 @@ export const lightTheme: Extension = EditorView.theme({
41
41
  */
42
42
  export const darkTheme: Extension = EditorView.theme(
43
43
  {
44
- "&": {
45
- backgroundColor: "#1e1e2e",
46
- color: "#cdd6f4",
44
+ '&': {
45
+ backgroundColor: '#1e1e2e',
46
+ color: '#cdd6f4',
47
47
  },
48
- ".cm-content": {
49
- caretColor: "#f5e0dc",
48
+ '.cm-content': {
49
+ caretColor: '#f5e0dc',
50
50
  },
51
- ".cm-cursor": {
52
- borderLeftColor: "#f5e0dc",
51
+ '.cm-cursor': {
52
+ borderLeftColor: '#f5e0dc',
53
53
  },
54
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": {
55
- backgroundColor: "#45475a",
54
+ '&.cm-focused .cm-selectionBackground, .cm-selectionBackground': {
55
+ backgroundColor: '#45475a',
56
56
  },
57
- ".cm-gutters": {
58
- backgroundColor: "#181825",
59
- color: "#585b70",
60
- borderRight: "1px solid #313244",
57
+ '.cm-gutters': {
58
+ backgroundColor: '#181825',
59
+ color: '#585b70',
60
+ borderRight: '1px solid #313244',
61
61
  },
62
- ".cm-activeLineGutter": {
63
- backgroundColor: "#1e1e2e",
64
- color: "#a6adc8",
62
+ '.cm-activeLineGutter': {
63
+ backgroundColor: '#1e1e2e',
64
+ color: '#a6adc8',
65
65
  },
66
- ".cm-activeLine": {
67
- backgroundColor: "#1e1e2e80",
66
+ '.cm-activeLine': {
67
+ backgroundColor: '#1e1e2e80',
68
68
  },
69
- ".cm-foldGutter": {
70
- color: "#585b70",
69
+ '.cm-foldGutter': {
70
+ color: '#585b70',
71
71
  },
72
- ".cm-matchingBracket": {
73
- backgroundColor: "#45475a",
74
- color: "#f5e0dc",
72
+ '.cm-matchingBracket': {
73
+ backgroundColor: '#45475a',
74
+ color: '#f5e0dc',
75
75
  },
76
76
  },
77
77
  { dark: true },
@@ -81,7 +81,7 @@ export const darkTheme: Extension = EditorView.theme(
81
81
  * Resolve a theme value to a CodeMirror extension.
82
82
  */
83
83
  export function resolveTheme(theme: EditorTheme): Extension {
84
- if (theme === "light") return lightTheme
85
- if (theme === "dark") return darkTheme
84
+ if (theme === 'light') return lightTheme
85
+ if (theme === 'dark') return darkTheme
86
86
  return theme // custom Extension
87
87
  }
package/src/types.ts CHANGED
@@ -1,32 +1,32 @@
1
- import type { Extension } from "@codemirror/state"
2
- import type { EditorView } from "@codemirror/view"
3
- import type { Computed, Signal } from "@pyreon/reactivity"
1
+ import type { Extension } from '@codemirror/state'
2
+ import type { EditorView } from '@codemirror/view'
3
+ import type { Computed, Signal } from '@pyreon/reactivity'
4
4
 
5
5
  // ─── Editor config ───────────────────────────────────────────────────────────
6
6
 
7
7
  export type EditorLanguage =
8
- | "javascript"
9
- | "typescript"
10
- | "jsx"
11
- | "tsx"
12
- | "html"
13
- | "css"
14
- | "json"
15
- | "markdown"
16
- | "python"
17
- | "rust"
18
- | "sql"
19
- | "xml"
20
- | "yaml"
21
- | "cpp"
22
- | "java"
23
- | "go"
24
- | "php"
25
- | "ruby"
26
- | "shell"
27
- | "plain"
28
-
29
- export type EditorTheme = "light" | "dark" | Extension
8
+ | 'javascript'
9
+ | 'typescript'
10
+ | 'jsx'
11
+ | 'tsx'
12
+ | 'html'
13
+ | 'css'
14
+ | 'json'
15
+ | 'markdown'
16
+ | 'python'
17
+ | 'rust'
18
+ | 'sql'
19
+ | 'xml'
20
+ | 'yaml'
21
+ | 'cpp'
22
+ | 'java'
23
+ | 'go'
24
+ | 'php'
25
+ | 'ruby'
26
+ | 'shell'
27
+ | 'plain'
28
+
29
+ export type EditorTheme = 'light' | 'dark' | Extension
30
30
 
31
31
  export interface EditorConfig {
32
32
  /** Initial value */
@@ -146,7 +146,7 @@ export interface Diagnostic {
146
146
  /** End position (character offset) */
147
147
  to: number
148
148
  /** Severity */
149
- severity: "error" | "warning" | "info" | "hint"
149
+ severity: 'error' | 'warning' | 'info' | 'hint'
150
150
  /** Message */
151
151
  message: string
152
152
  /** Optional source (e.g., "typescript", "eslint") */
@@ -212,7 +212,7 @@ export interface TabbedEditorConfig {
212
212
  /** Theme — 'light', 'dark', or custom */
213
213
  theme?: EditorTheme
214
214
  /** Editor config applied to all tabs */
215
- editorConfig?: Omit<EditorConfig, "value" | "language" | "theme">
215
+ editorConfig?: Omit<EditorConfig, 'value' | 'language' | 'theme'>
216
216
  }
217
217
 
218
218
  export interface TabbedEditorInstance {