termcast 1.3.48 → 1.3.49
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/dist/build.d.ts.map +1 -1
- package/dist/build.js +12 -0
- package/dist/build.js.map +1 -1
- package/dist/cli.js +5 -40
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +7 -7
- package/dist/colors.js +7 -7
- package/dist/compile.d.ts +6 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +45 -26
- package/dist/compile.js.map +1 -1
- package/dist/components/actions.js +1 -1
- package/dist/components/actions.js.map +1 -1
- package/dist/components/bar-chart.d.ts +38 -0
- package/dist/components/bar-chart.d.ts.map +1 -0
- package/dist/components/bar-chart.js +158 -0
- package/dist/components/bar-chart.js.map +1 -0
- package/dist/components/bar-graph.d.ts +41 -0
- package/dist/components/bar-graph.d.ts.map +1 -0
- package/dist/components/bar-graph.js +95 -0
- package/dist/components/bar-graph.js.map +1 -0
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +5 -7
- package/dist/components/detail.js.map +1 -1
- package/dist/components/footer.d.ts.map +1 -1
- package/dist/components/footer.js +8 -9
- package/dist/components/footer.js.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.js +7 -1
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/dropdown.d.ts.map +1 -1
- package/dist/components/form/dropdown.js +10 -2
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +4 -5
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/use-form-navigation.d.ts.map +1 -1
- package/dist/components/form/use-form-navigation.js +6 -0
- package/dist/components/form/use-form-navigation.js.map +1 -1
- package/dist/components/graph.d.ts +111 -0
- package/dist/components/graph.d.ts.map +1 -0
- package/dist/components/graph.js +392 -0
- package/dist/components/graph.js.map +1 -0
- package/dist/components/icon.js +5 -5
- package/dist/components/icon.js.map +1 -1
- package/dist/components/list.d.ts +53 -5
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +125 -71
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +3 -3
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/loading-text.d.ts +1 -1
- package/dist/components/loading-text.d.ts.map +1 -1
- package/dist/components/loading-text.js +3 -1
- package/dist/components/loading-text.js.map +1 -1
- package/dist/components/metadata.js +2 -2
- package/dist/components/metadata.js.map +1 -1
- package/dist/components/row.d.ts +10 -0
- package/dist/components/row.d.ts.map +1 -0
- package/dist/components/row.js +12 -0
- package/dist/components/row.js.map +1 -0
- package/dist/components/table.d.ts +57 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +365 -0
- package/dist/components/table.js.map +1 -0
- package/dist/descendants.js +13 -13
- package/dist/descendants.js.map +1 -1
- package/dist/examples/bar-graph-weekly.d.ts +2 -0
- package/dist/examples/bar-graph-weekly.d.ts.map +1 -0
- package/dist/examples/bar-graph-weekly.js +95 -0
- package/dist/examples/bar-graph-weekly.js.map +1 -0
- package/dist/examples/components-weird-places.d.ts +2 -0
- package/dist/examples/components-weird-places.d.ts.map +1 -0
- package/dist/examples/components-weird-places.js +46 -0
- package/dist/examples/components-weird-places.js.map +1 -0
- package/dist/examples/graph-bar-chart.d.ts +2 -0
- package/dist/examples/graph-bar-chart.d.ts.map +1 -0
- package/dist/examples/graph-bar-chart.js +270 -0
- package/dist/examples/graph-bar-chart.js.map +1 -0
- package/dist/examples/graph-multi-series.d.ts +2 -0
- package/dist/examples/graph-multi-series.d.ts.map +1 -0
- package/dist/examples/graph-multi-series.js +23 -0
- package/dist/examples/graph-multi-series.js.map +1 -0
- package/dist/examples/graph-polymarket.d.ts +2 -0
- package/dist/examples/graph-polymarket.d.ts.map +1 -0
- package/dist/examples/graph-polymarket.js +109 -0
- package/dist/examples/graph-polymarket.js.map +1 -0
- package/dist/examples/graph-row.d.ts +2 -0
- package/dist/examples/graph-row.d.ts.map +1 -0
- package/dist/examples/graph-row.js +226 -0
- package/dist/examples/graph-row.js.map +1 -0
- package/dist/examples/graph-styles.d.ts +2 -0
- package/dist/examples/graph-styles.d.ts.map +1 -0
- package/dist/examples/graph-styles.js +316 -0
- package/dist/examples/graph-styles.js.map +1 -0
- package/dist/examples/list-accessory-table.d.ts +2 -0
- package/dist/examples/list-accessory-table.d.ts.map +1 -0
- package/dist/examples/list-accessory-table.js +46 -0
- package/dist/examples/list-accessory-table.js.map +1 -0
- package/dist/examples/list-item-accessories.d.ts +2 -0
- package/dist/examples/list-item-accessories.d.ts.map +1 -0
- package/dist/examples/list-item-accessories.js +27 -0
- package/dist/examples/list-item-accessories.js.map +1 -0
- package/dist/examples/list-no-actions.d.ts +2 -0
- package/dist/examples/list-no-actions.d.ts.map +1 -0
- package/dist/examples/list-no-actions.js +7 -0
- package/dist/examples/list-no-actions.js.map +1 -0
- package/dist/examples/simple-detail-table.d.ts +2 -0
- package/dist/examples/simple-detail-table.d.ts.map +1 -0
- package/dist/examples/simple-detail-table.js +45 -0
- package/dist/examples/simple-detail-table.js.map +1 -0
- package/dist/examples/simple-graph.d.ts +2 -0
- package/dist/examples/simple-graph.d.ts.map +1 -0
- package/dist/examples/simple-graph.js +32 -0
- package/dist/examples/simple-graph.js.map +1 -0
- package/dist/examples/simple-table-wrap.d.ts +2 -0
- package/dist/examples/simple-table-wrap.d.ts.map +1 -0
- package/dist/examples/simple-table-wrap.js +37 -0
- package/dist/examples/simple-table-wrap.js.map +1 -0
- package/dist/examples/table-edge-cases.d.ts +2 -0
- package/dist/examples/table-edge-cases.d.ts.map +1 -0
- package/dist/examples/table-edge-cases.js +70 -0
- package/dist/examples/table-edge-cases.js.map +1 -0
- package/dist/examples/table-flex-grow.d.ts +2 -0
- package/dist/examples/table-flex-grow.d.ts.map +1 -0
- package/dist/examples/table-flex-grow.js +18 -0
- package/dist/examples/table-flex-grow.js.map +1 -0
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +5 -1
- package/dist/extensions/dev.js.map +1 -1
- package/dist/globals.d.ts +1 -0
- package/dist/globals.d.ts.map +1 -1
- package/dist/globals.js +2 -0
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker-widget.d.ts.map +1 -1
- package/dist/internal/date-picker-widget.js +4 -0
- package/dist/internal/date-picker-widget.js.map +1 -1
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +1 -3
- package/dist/internal/providers.js.map +1 -1
- package/dist/markdown-utils.d.ts +22 -1
- package/dist/markdown-utils.d.ts.map +1 -1
- package/dist/markdown-utils.js +66 -1
- package/dist/markdown-utils.js.map +1 -1
- package/dist/opentui.d.ts +4 -0
- package/dist/opentui.d.ts.map +1 -0
- package/dist/opentui.js +3 -0
- package/dist/opentui.js.map +1 -0
- package/dist/release.d.ts +2 -1
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +2 -1
- package/dist/release.js.map +1 -1
- package/dist/state.d.ts +1 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -1
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +13 -0
- package/dist/theme.js.map +1 -1
- package/dist/themes/nerv.json +227 -0
- package/dist/themes/termcast.json +72 -71
- package/dist/themes.d.ts +2 -1
- package/dist/themes.d.ts.map +1 -1
- package/dist/themes.js +7 -5
- package/dist/themes.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -0
- package/dist/utils.js.map +1 -1
- package/package.json +12 -4
- package/src/build.tsx +13 -0
- package/src/cli.tsx +5 -49
- package/src/colors.tsx +7 -7
- package/src/compile.tsx +52 -29
- package/src/components/actions.tsx +1 -1
- package/src/components/bar-chart.tsx +271 -0
- package/src/components/bar-graph.tsx +214 -0
- package/src/components/detail.tsx +7 -8
- package/src/components/footer.tsx +14 -15
- package/src/components/form/date-picker.tsx +9 -0
- package/src/components/form/dropdown.tsx +13 -3
- package/src/components/form/index.tsx +4 -6
- package/src/components/form/use-form-navigation.tsx +6 -0
- package/src/components/graph.tsx +506 -0
- package/src/components/icon.tsx +5 -5
- package/src/components/list.tsx +210 -102
- package/src/components/loading-bar.tsx +3 -3
- package/src/components/loading-text.tsx +4 -2
- package/src/components/metadata.tsx +2 -2
- package/src/components/row.tsx +31 -0
- package/src/components/table.tsx +511 -0
- package/src/descendants.tsx +13 -13
- package/src/examples/action-shortcut.vitest.tsx +1 -1
- package/src/examples/actions-context.vitest.tsx +1 -1
- package/src/examples/bar-graph-weekly.tsx +264 -0
- package/src/examples/bar-graph-weekly.vitest.tsx +275 -0
- package/src/examples/detail-metadata-showcase.vitest.tsx +8 -8
- package/src/examples/form-basic.vitest.tsx +239 -0
- package/src/examples/form-dropdown.vitest.tsx +29 -29
- package/src/examples/form-tagpicker.vitest.tsx +27 -27
- package/src/examples/github.vitest.tsx +4 -4
- package/src/examples/graph-bar-chart.tsx +408 -0
- package/src/examples/graph-bar-chart.vitest.tsx +283 -0
- package/src/examples/graph-multi-series.tsx +36 -0
- package/src/examples/graph-multi-series.vitest.tsx +89 -0
- package/src/examples/graph-polymarket.tsx +182 -0
- package/src/examples/graph-polymarket.vitest.tsx +130 -0
- package/src/examples/graph-row.tsx +347 -0
- package/src/examples/graph-row.vitest.tsx +295 -0
- package/src/examples/graph-styles.tsx +457 -0
- package/src/examples/graph-styles.vitest.tsx +322 -0
- package/src/examples/list-accessory-table.tsx +77 -0
- package/src/examples/list-detail-metadata.vitest.tsx +21 -21
- package/src/examples/list-dropdown-default.vitest.tsx +12 -12
- package/src/examples/list-item-accessories.tsx +106 -0
- package/src/examples/list-item-accessories.vitest.tsx +115 -0
- package/src/examples/list-no-actions.tsx +18 -0
- package/src/examples/list-no-actions.vitest.tsx +97 -0
- package/src/examples/list-spacing-mode.vitest.tsx +6 -6
- package/src/examples/list-with-detail.vitest.tsx +92 -92
- package/src/examples/list-with-dropdown.vitest.tsx +49 -6
- package/src/examples/list-with-sections.vitest.tsx +61 -56
- package/src/examples/simple-detail-markdown.vitest.tsx +21 -17
- package/src/examples/simple-detail-table.tsx +65 -0
- package/src/examples/simple-detail-table.vitest.tsx +200 -0
- package/src/examples/simple-graph.tsx +51 -0
- package/src/examples/simple-graph.vitest.tsx +124 -0
- package/src/examples/simple-grid.vitest.tsx +3 -3
- package/src/examples/simple-list-search.vitest.tsx +65 -0
- package/src/examples/simple-navigation.vitest.tsx +3 -3
- package/src/examples/simple-table-wrap.tsx +55 -0
- package/src/examples/simple-table-wrap.vitest.tsx +91 -0
- package/src/examples/store.vitest.tsx +1 -1
- package/src/examples/table-edge-cases.tsx +72 -0
- package/src/examples/table-edge-cases.vitest.tsx +307 -0
- package/src/examples/table-flex-grow.tsx +53 -0
- package/src/examples/table-flex-grow.vitest.tsx +124 -0
- package/src/extensions/dev.tsx +7 -1
- package/src/globals.ts +3 -0
- package/src/index.tsx +31 -0
- package/src/internal/date-picker-widget.tsx +4 -0
- package/src/internal/providers.tsx +1 -4
- package/src/markdown-utils.tsx +82 -1
- package/src/opentui.tsx +5 -0
- package/src/release.tsx +3 -0
- package/src/state.tsx +2 -1
- package/src/theme.tsx +14 -0
- package/src/themes/nerv.json +231 -0
- package/src/themes/termcast.json +75 -71
- package/src/themes.ts +8 -5
- package/src/utils.tsx +4 -0
package/src/markdown-utils.tsx
CHANGED
|
@@ -18,9 +18,12 @@ import {
|
|
|
18
18
|
createTextAttributes,
|
|
19
19
|
type Renderable,
|
|
20
20
|
type RenderContext,
|
|
21
|
+
type SyntaxStyle,
|
|
21
22
|
} from '@opentui/core'
|
|
23
|
+
import { Lexer } from 'marked'
|
|
22
24
|
import { getResolvedTheme } from './themes'
|
|
23
25
|
import { useStore } from './state'
|
|
26
|
+
import { TableRenderable, type TableCellContent } from 'termcast/src/components/table'
|
|
24
27
|
|
|
25
28
|
// Minimal token types from marked (dependency of opentui, not termcast directly)
|
|
26
29
|
interface Token {
|
|
@@ -29,10 +32,19 @@ interface Token {
|
|
|
29
32
|
raw?: string
|
|
30
33
|
href?: string
|
|
31
34
|
tokens?: Token[]
|
|
35
|
+
// Table-specific fields (from marked Tokens.Table)
|
|
36
|
+
header?: TableCell[]
|
|
37
|
+
rows?: TableCell[][]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface TableCell {
|
|
41
|
+
text: string
|
|
42
|
+
tokens: Token[]
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
// Matches RenderNodeContext from @opentui/core/renderables/Markdown
|
|
35
46
|
interface RenderNodeContext {
|
|
47
|
+
syntaxStyle: SyntaxStyle
|
|
36
48
|
defaultRender: () => Renderable | null
|
|
37
49
|
}
|
|
38
50
|
|
|
@@ -53,7 +65,9 @@ function hasLinks(token: Token): boolean {
|
|
|
53
65
|
|
|
54
66
|
// Recursively flatten inline tokens into chunks, stripping link URLs.
|
|
55
67
|
// Handles nested structures like **[link](url)** or *[link](url)*.
|
|
56
|
-
|
|
68
|
+
// Exported so the standalone <Table> component can reuse this for
|
|
69
|
+
// parsing inline markdown in cell strings.
|
|
70
|
+
export function flattenInlineTokens({
|
|
57
71
|
tokens,
|
|
58
72
|
chunks,
|
|
59
73
|
links,
|
|
@@ -150,6 +164,51 @@ export function createMarkdownRenderNode(renderer: RenderContext): (token: Token
|
|
|
150
164
|
let nodeCounter = 0
|
|
151
165
|
|
|
152
166
|
return (token: Token, context: RenderNodeContext) => {
|
|
167
|
+
// Override table tokens with our custom borderless TableRenderable
|
|
168
|
+
// (header background + alternating row stripes instead of ASCII borders).
|
|
169
|
+
// Converts inline markdown tokens (bold, italic, code, links) into
|
|
170
|
+
// StyledText so formatting is preserved in table cells.
|
|
171
|
+
if (token.type === 'table' && token.header && token.rows) {
|
|
172
|
+
const themeName = useStore.getState().currentThemeName
|
|
173
|
+
const theme = getResolvedTheme(themeName)
|
|
174
|
+
const primaryColor = parseColor(theme.primary)
|
|
175
|
+
const linkColor = parseColor(theme.markdownLinkText)
|
|
176
|
+
const textColor = parseColor(theme.text)
|
|
177
|
+
|
|
178
|
+
const cellToStyledText = (tokens: Token[] | undefined): TableCellContent => {
|
|
179
|
+
if (!tokens || tokens.length === 0) {
|
|
180
|
+
return new StyledText([{ __isChunk: true, text: ' ', fg: textColor }])
|
|
181
|
+
}
|
|
182
|
+
const chunks: TextChunk[] = []
|
|
183
|
+
const links: LinkInfo[] = []
|
|
184
|
+
flattenInlineTokens({ tokens, chunks, links, primaryColor, linkColor, textColor })
|
|
185
|
+
if (chunks.length === 0) {
|
|
186
|
+
return new StyledText([{ __isChunk: true, text: ' ', fg: textColor }])
|
|
187
|
+
}
|
|
188
|
+
return new StyledText(chunks)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const headers = token.header.map((cell) => {
|
|
192
|
+
return cellToStyledText(cell.tokens)
|
|
193
|
+
})
|
|
194
|
+
const rows = token.rows.map((row) => {
|
|
195
|
+
return row.map((cell) => {
|
|
196
|
+
return cellToStyledText(cell.tokens)
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
if (headers.length === 0 || rows.length === 0) {
|
|
200
|
+
return undefined
|
|
201
|
+
}
|
|
202
|
+
return new TableRenderable(renderer, {
|
|
203
|
+
id: `table-${nodeCounter++}`,
|
|
204
|
+
headers,
|
|
205
|
+
rows,
|
|
206
|
+
syntaxStyle: context.syntaxStyle,
|
|
207
|
+
width: '100%',
|
|
208
|
+
marginBottom: 1,
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
|
|
153
212
|
// Only override paragraphs that contain links (including nested)
|
|
154
213
|
if (token.type !== 'paragraph' || !hasLinks(token)) {
|
|
155
214
|
return undefined // use default rendering
|
|
@@ -180,3 +239,25 @@ export function createMarkdownRenderNode(renderer: RenderContext): (token: Token
|
|
|
180
239
|
})
|
|
181
240
|
}
|
|
182
241
|
}
|
|
242
|
+
|
|
243
|
+
// Parse a raw string containing inline markdown (bold, italic, code,
|
|
244
|
+
// links, strikethrough) into a StyledText. Uses marked's inline lexer
|
|
245
|
+
// to tokenize, then flattenInlineTokens to produce styled chunks.
|
|
246
|
+
// If the string contains no markdown syntax, returns a plain StyledText.
|
|
247
|
+
export function parseInlineMarkdown(text: string): StyledText {
|
|
248
|
+
const themeName = useStore.getState().currentThemeName
|
|
249
|
+
const theme = getResolvedTheme(themeName)
|
|
250
|
+
const primaryColor = parseColor(theme.primary)
|
|
251
|
+
const linkColor = parseColor(theme.markdownLinkText)
|
|
252
|
+
const textColor = parseColor(theme.text)
|
|
253
|
+
|
|
254
|
+
const tokens = new Lexer().inlineTokens(text) as Token[]
|
|
255
|
+
const chunks: TextChunk[] = []
|
|
256
|
+
const links: LinkInfo[] = []
|
|
257
|
+
flattenInlineTokens({ tokens, chunks, links, primaryColor, linkColor, textColor })
|
|
258
|
+
|
|
259
|
+
if (chunks.length === 0) {
|
|
260
|
+
return new StyledText([{ __isChunk: true, text: ' ', fg: textColor }])
|
|
261
|
+
}
|
|
262
|
+
return new StyledText(chunks)
|
|
263
|
+
}
|
package/src/opentui.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from '@opentui/core'
|
|
2
|
+
export * from '@opentui/react'
|
|
3
|
+
// Disambiguate names exported by both core and react (type-only to avoid
|
|
4
|
+
// runtime errors when the JS bundle doesn't actually export the name)
|
|
5
|
+
export type { RenderableConstructor } from '@opentui/core'
|
package/src/release.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
export interface ReleaseOptions {
|
|
16
16
|
extensionPath: string
|
|
17
17
|
single?: boolean
|
|
18
|
+
entry?: string
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface ReleaseResult {
|
|
@@ -27,6 +28,7 @@ export interface ReleaseResult {
|
|
|
27
28
|
export async function releaseExtension({
|
|
28
29
|
extensionPath,
|
|
29
30
|
single = false,
|
|
31
|
+
entry,
|
|
30
32
|
}: ReleaseOptions): Promise<ReleaseResult> {
|
|
31
33
|
const resolvedPath = path.resolve(extensionPath)
|
|
32
34
|
|
|
@@ -127,6 +129,7 @@ export async function releaseExtension({
|
|
|
127
129
|
minify: true,
|
|
128
130
|
target,
|
|
129
131
|
version: tag,
|
|
132
|
+
entry,
|
|
130
133
|
})
|
|
131
134
|
|
|
132
135
|
console.log(` ✓ ${path.basename(result.outfile)}`)
|
package/src/state.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export interface NavigationStackItem {
|
|
|
45
45
|
element: ReactNode
|
|
46
46
|
onPop?: () => void
|
|
47
47
|
selectedListIndex?: number
|
|
48
|
+
searchText?: string
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
interface AppState {
|
|
@@ -109,7 +110,7 @@ export const useStore = create<AppState>(() => ({
|
|
|
109
110
|
showActionsDialog: false,
|
|
110
111
|
actionsPortalTarget: null,
|
|
111
112
|
// Theme state
|
|
112
|
-
currentThemeName: '
|
|
113
|
+
currentThemeName: 'nerv',
|
|
113
114
|
// Active search input ref
|
|
114
115
|
activeSearchInputRef: null,
|
|
115
116
|
// Registered action shortcuts
|
package/src/theme.tsx
CHANGED
|
@@ -58,6 +58,20 @@ export function getMarkdownSyntaxStyle(): SyntaxStyle {
|
|
|
58
58
|
return SyntaxStyle.fromStyles(getSyntaxTheme(themeName))
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
// Shared color palette for all chart components (Graph, BarChart, BarGraph).
|
|
62
|
+
// Order: accent, info, success, warning, error, secondary, primary (cycles with %).
|
|
63
|
+
export function getThemePalette(theme: ResolvedTheme): string[] {
|
|
64
|
+
return [
|
|
65
|
+
theme.accent,
|
|
66
|
+
theme.info,
|
|
67
|
+
theme.success,
|
|
68
|
+
theme.warning,
|
|
69
|
+
theme.error,
|
|
70
|
+
theme.secondary,
|
|
71
|
+
theme.primary,
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
|
|
61
75
|
// For backward compatibility - some code imports markdownSyntaxStyle directly
|
|
62
76
|
// This is a getter that returns the current theme's syntax style
|
|
63
77
|
export const markdownSyntaxStyle = new Proxy({} as SyntaxStyle, {
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/theme.json",
|
|
3
|
+
"defs": {
|
|
4
|
+
"darkStep1": "#181818",
|
|
5
|
+
"darkStep2": "#181818",
|
|
6
|
+
"darkStep3": "#282828",
|
|
7
|
+
"darkStep4": "#333333",
|
|
8
|
+
"darkStep5": "#404040",
|
|
9
|
+
"darkStep6": "#505050",
|
|
10
|
+
"darkStep7": "#606060",
|
|
11
|
+
"darkStep8": "#808080",
|
|
12
|
+
"darkStep11": "#999999",
|
|
13
|
+
"darkStep12": "#FFFFFF",
|
|
14
|
+
|
|
15
|
+
"darkOrange": "#E89500",
|
|
16
|
+
"darkOrangeBright": "#FFAA15",
|
|
17
|
+
"darkOrangeDim": "#C07800",
|
|
18
|
+
"darkOrangeDeep": "#A05C00",
|
|
19
|
+
"darkOrangeWash": "#FFBB50",
|
|
20
|
+
|
|
21
|
+
"darkGreen": "#2BBD50",
|
|
22
|
+
"darkGreenBright": "#44DD66",
|
|
23
|
+
"darkGreenDim": "#1F9940",
|
|
24
|
+
"darkGreenDeep": "#167030",
|
|
25
|
+
|
|
26
|
+
"darkSalmon": "#F7768E"
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
"theme": {
|
|
30
|
+
"primary": {
|
|
31
|
+
"dark": "darkOrange",
|
|
32
|
+
"light": "darkOrange"
|
|
33
|
+
},
|
|
34
|
+
"secondary": {
|
|
35
|
+
"dark": "darkOrangeDim",
|
|
36
|
+
"light": "darkOrangeDim"
|
|
37
|
+
},
|
|
38
|
+
"accent": {
|
|
39
|
+
"dark": "darkOrangeBright",
|
|
40
|
+
"light": "darkOrangeBright"
|
|
41
|
+
},
|
|
42
|
+
"error": {
|
|
43
|
+
"dark": "darkSalmon",
|
|
44
|
+
"light": "darkSalmon"
|
|
45
|
+
},
|
|
46
|
+
"warning": {
|
|
47
|
+
"dark": "darkOrangeWash",
|
|
48
|
+
"light": "darkOrangeWash"
|
|
49
|
+
},
|
|
50
|
+
"success": {
|
|
51
|
+
"dark": "darkGreen",
|
|
52
|
+
"light": "darkGreen"
|
|
53
|
+
},
|
|
54
|
+
"info": {
|
|
55
|
+
"dark": "darkGreenBright",
|
|
56
|
+
"light": "darkGreenBright"
|
|
57
|
+
},
|
|
58
|
+
"text": {
|
|
59
|
+
"dark": "darkStep12",
|
|
60
|
+
"light": "darkStep12"
|
|
61
|
+
},
|
|
62
|
+
"textMuted": {
|
|
63
|
+
"dark": "darkStep11",
|
|
64
|
+
"light": "darkStep11"
|
|
65
|
+
},
|
|
66
|
+
"background": {
|
|
67
|
+
"dark": "darkStep1",
|
|
68
|
+
"light": "darkStep1"
|
|
69
|
+
},
|
|
70
|
+
"backgroundPanel": {
|
|
71
|
+
"dark": "darkStep2",
|
|
72
|
+
"light": "darkStep2"
|
|
73
|
+
},
|
|
74
|
+
"backgroundElement": {
|
|
75
|
+
"dark": "darkStep3",
|
|
76
|
+
"light": "darkStep3"
|
|
77
|
+
},
|
|
78
|
+
"border": {
|
|
79
|
+
"dark": "darkStep4",
|
|
80
|
+
"light": "darkStep4"
|
|
81
|
+
},
|
|
82
|
+
"borderActive": {
|
|
83
|
+
"dark": "darkOrange",
|
|
84
|
+
"light": "darkOrange"
|
|
85
|
+
},
|
|
86
|
+
"borderSubtle": {
|
|
87
|
+
"dark": "#252525",
|
|
88
|
+
"light": "#252525"
|
|
89
|
+
},
|
|
90
|
+
"diffAdded": {
|
|
91
|
+
"dark": "darkGreen",
|
|
92
|
+
"light": "darkGreen"
|
|
93
|
+
},
|
|
94
|
+
"diffRemoved": {
|
|
95
|
+
"dark": "darkSalmon",
|
|
96
|
+
"light": "darkSalmon"
|
|
97
|
+
},
|
|
98
|
+
"diffContext": {
|
|
99
|
+
"dark": "darkStep11",
|
|
100
|
+
"light": "darkStep11"
|
|
101
|
+
},
|
|
102
|
+
"diffHunkHeader": {
|
|
103
|
+
"dark": "darkStep11",
|
|
104
|
+
"light": "darkStep11"
|
|
105
|
+
},
|
|
106
|
+
"diffHighlightAdded": {
|
|
107
|
+
"dark": "darkGreenBright",
|
|
108
|
+
"light": "darkGreenBright"
|
|
109
|
+
},
|
|
110
|
+
"diffHighlightRemoved": {
|
|
111
|
+
"dark": "darkSalmon",
|
|
112
|
+
"light": "darkSalmon"
|
|
113
|
+
},
|
|
114
|
+
"diffAddedBg": {
|
|
115
|
+
"dark": "#1A2B1E",
|
|
116
|
+
"light": "#1A2B1E"
|
|
117
|
+
},
|
|
118
|
+
"diffRemovedBg": {
|
|
119
|
+
"dark": "#37222c",
|
|
120
|
+
"light": "#37222c"
|
|
121
|
+
},
|
|
122
|
+
"diffContextBg": {
|
|
123
|
+
"dark": "darkStep2",
|
|
124
|
+
"light": "darkStep2"
|
|
125
|
+
},
|
|
126
|
+
"diffLineNumber": {
|
|
127
|
+
"dark": "darkStep4",
|
|
128
|
+
"light": "darkStep4"
|
|
129
|
+
},
|
|
130
|
+
"diffAddedLineNumberBg": {
|
|
131
|
+
"dark": "#162518",
|
|
132
|
+
"light": "#162518"
|
|
133
|
+
},
|
|
134
|
+
"diffRemovedLineNumberBg": {
|
|
135
|
+
"dark": "#2d1f26",
|
|
136
|
+
"light": "#2d1f26"
|
|
137
|
+
},
|
|
138
|
+
"markdownText": {
|
|
139
|
+
"dark": "darkStep12",
|
|
140
|
+
"light": "darkStep12"
|
|
141
|
+
},
|
|
142
|
+
"markdownHeading": {
|
|
143
|
+
"dark": "darkOrange",
|
|
144
|
+
"light": "darkOrange"
|
|
145
|
+
},
|
|
146
|
+
"markdownLink": {
|
|
147
|
+
"dark": "darkGreen",
|
|
148
|
+
"light": "darkGreen"
|
|
149
|
+
},
|
|
150
|
+
"markdownLinkText": {
|
|
151
|
+
"dark": "darkGreen",
|
|
152
|
+
"light": "darkGreen"
|
|
153
|
+
},
|
|
154
|
+
"markdownCode": {
|
|
155
|
+
"dark": "darkGreenDim",
|
|
156
|
+
"light": "darkGreenDim"
|
|
157
|
+
},
|
|
158
|
+
"markdownBlockQuote": {
|
|
159
|
+
"dark": "darkStep11",
|
|
160
|
+
"light": "darkStep11"
|
|
161
|
+
},
|
|
162
|
+
"markdownEmph": {
|
|
163
|
+
"dark": "darkOrangeWash",
|
|
164
|
+
"light": "darkOrangeWash"
|
|
165
|
+
},
|
|
166
|
+
"markdownStrong": {
|
|
167
|
+
"dark": "darkOrangeBright",
|
|
168
|
+
"light": "darkOrangeBright"
|
|
169
|
+
},
|
|
170
|
+
"markdownHorizontalRule": {
|
|
171
|
+
"dark": "darkStep11",
|
|
172
|
+
"light": "darkStep11"
|
|
173
|
+
},
|
|
174
|
+
"markdownListItem": {
|
|
175
|
+
"dark": "darkOrange",
|
|
176
|
+
"light": "darkOrange"
|
|
177
|
+
},
|
|
178
|
+
"markdownListEnumeration": {
|
|
179
|
+
"dark": "darkOrange",
|
|
180
|
+
"light": "darkOrange"
|
|
181
|
+
},
|
|
182
|
+
"markdownImage": {
|
|
183
|
+
"dark": "darkOrange",
|
|
184
|
+
"light": "darkOrange"
|
|
185
|
+
},
|
|
186
|
+
"markdownImageText": {
|
|
187
|
+
"dark": "darkGreen",
|
|
188
|
+
"light": "darkGreen"
|
|
189
|
+
},
|
|
190
|
+
"markdownCodeBlock": {
|
|
191
|
+
"dark": "darkStep12",
|
|
192
|
+
"light": "darkStep12"
|
|
193
|
+
},
|
|
194
|
+
"syntaxComment": {
|
|
195
|
+
"dark": "darkStep11",
|
|
196
|
+
"light": "darkStep11"
|
|
197
|
+
},
|
|
198
|
+
"syntaxKeyword": {
|
|
199
|
+
"dark": "darkOrange",
|
|
200
|
+
"light": "darkOrange"
|
|
201
|
+
},
|
|
202
|
+
"syntaxFunction": {
|
|
203
|
+
"dark": "darkOrangeBright",
|
|
204
|
+
"light": "darkOrangeBright"
|
|
205
|
+
},
|
|
206
|
+
"syntaxVariable": {
|
|
207
|
+
"dark": "darkSalmon",
|
|
208
|
+
"light": "darkSalmon"
|
|
209
|
+
},
|
|
210
|
+
"syntaxString": {
|
|
211
|
+
"dark": "darkGreenDim",
|
|
212
|
+
"light": "darkGreenDim"
|
|
213
|
+
},
|
|
214
|
+
"syntaxNumber": {
|
|
215
|
+
"dark": "darkOrangeWash",
|
|
216
|
+
"light": "darkOrangeWash"
|
|
217
|
+
},
|
|
218
|
+
"syntaxType": {
|
|
219
|
+
"dark": "darkGreenBright",
|
|
220
|
+
"light": "darkGreenBright"
|
|
221
|
+
},
|
|
222
|
+
"syntaxOperator": {
|
|
223
|
+
"dark": "darkGreen",
|
|
224
|
+
"light": "darkGreen"
|
|
225
|
+
},
|
|
226
|
+
"syntaxPunctuation": {
|
|
227
|
+
"dark": "darkStep12",
|
|
228
|
+
"light": "darkStep12"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
package/src/themes/termcast.json
CHANGED
|
@@ -9,47 +9,51 @@
|
|
|
9
9
|
"darkStep6": "#505050",
|
|
10
10
|
"darkStep7": "#606060",
|
|
11
11
|
"darkStep8": "#808080",
|
|
12
|
-
"darkStep9": "#FFC000",
|
|
13
|
-
"darkStep10": "#FFD040",
|
|
14
12
|
"darkStep11": "#999999",
|
|
15
13
|
"darkStep12": "#FFFFFF",
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
14
|
+
|
|
15
|
+
"darkOrange": "#E86500",
|
|
16
|
+
"darkOrangeBright": "#FF7800",
|
|
17
|
+
"darkOrangeDim": "#C05000",
|
|
18
|
+
"darkOrangeDeep": "#A03800",
|
|
19
|
+
"darkOrangeWash": "#FF9040",
|
|
20
|
+
|
|
21
|
+
"darkGreen": "#2BBD50",
|
|
22
|
+
"darkGreenBright": "#44DD66",
|
|
23
|
+
"darkGreenDim": "#1F9940",
|
|
24
|
+
"darkGreenDeep": "#167030",
|
|
25
|
+
|
|
26
|
+
"darkSalmon": "#F7768E"
|
|
23
27
|
},
|
|
24
28
|
|
|
25
29
|
"theme": {
|
|
26
30
|
"primary": {
|
|
27
|
-
"dark": "
|
|
28
|
-
"light": "
|
|
31
|
+
"dark": "darkOrange",
|
|
32
|
+
"light": "darkOrange"
|
|
29
33
|
},
|
|
30
34
|
"secondary": {
|
|
31
|
-
"dark": "
|
|
32
|
-
"light": "
|
|
35
|
+
"dark": "darkOrangeDim",
|
|
36
|
+
"light": "darkOrangeDim"
|
|
33
37
|
},
|
|
34
38
|
"accent": {
|
|
35
|
-
"dark": "
|
|
36
|
-
"light": "
|
|
39
|
+
"dark": "darkOrangeBright",
|
|
40
|
+
"light": "darkOrangeBright"
|
|
37
41
|
},
|
|
38
42
|
"error": {
|
|
39
|
-
"dark": "
|
|
40
|
-
"light": "
|
|
43
|
+
"dark": "darkSalmon",
|
|
44
|
+
"light": "darkSalmon"
|
|
41
45
|
},
|
|
42
46
|
"warning": {
|
|
43
|
-
"dark": "
|
|
44
|
-
"light": "
|
|
47
|
+
"dark": "darkOrangeWash",
|
|
48
|
+
"light": "darkOrangeWash"
|
|
45
49
|
},
|
|
46
50
|
"success": {
|
|
47
|
-
"dark": "
|
|
48
|
-
"light": "
|
|
51
|
+
"dark": "darkGreen",
|
|
52
|
+
"light": "darkGreen"
|
|
49
53
|
},
|
|
50
54
|
"info": {
|
|
51
|
-
"dark": "
|
|
52
|
-
"light": "
|
|
55
|
+
"dark": "darkGreenBright",
|
|
56
|
+
"light": "darkGreenBright"
|
|
53
57
|
},
|
|
54
58
|
"text": {
|
|
55
59
|
"dark": "darkStep12",
|
|
@@ -76,20 +80,20 @@
|
|
|
76
80
|
"light": "darkStep4"
|
|
77
81
|
},
|
|
78
82
|
"borderActive": {
|
|
79
|
-
"dark": "
|
|
80
|
-
"light": "
|
|
83
|
+
"dark": "darkOrange",
|
|
84
|
+
"light": "darkOrange"
|
|
81
85
|
},
|
|
82
86
|
"borderSubtle": {
|
|
83
87
|
"dark": "#252525",
|
|
84
88
|
"light": "#252525"
|
|
85
89
|
},
|
|
86
90
|
"diffAdded": {
|
|
87
|
-
"dark": "
|
|
88
|
-
"light": "
|
|
91
|
+
"dark": "darkGreen",
|
|
92
|
+
"light": "darkGreen"
|
|
89
93
|
},
|
|
90
94
|
"diffRemoved": {
|
|
91
|
-
"dark": "
|
|
92
|
-
"light": "
|
|
95
|
+
"dark": "darkSalmon",
|
|
96
|
+
"light": "darkSalmon"
|
|
93
97
|
},
|
|
94
98
|
"diffContext": {
|
|
95
99
|
"dark": "darkStep11",
|
|
@@ -100,16 +104,16 @@
|
|
|
100
104
|
"light": "darkStep11"
|
|
101
105
|
},
|
|
102
106
|
"diffHighlightAdded": {
|
|
103
|
-
"dark": "
|
|
104
|
-
"light": "
|
|
107
|
+
"dark": "darkGreenBright",
|
|
108
|
+
"light": "darkGreenBright"
|
|
105
109
|
},
|
|
106
110
|
"diffHighlightRemoved": {
|
|
107
|
-
"dark": "
|
|
108
|
-
"light": "
|
|
111
|
+
"dark": "darkSalmon",
|
|
112
|
+
"light": "darkSalmon"
|
|
109
113
|
},
|
|
110
114
|
"diffAddedBg": {
|
|
111
|
-
"dark": "#
|
|
112
|
-
"light": "#
|
|
115
|
+
"dark": "#1A2B1E",
|
|
116
|
+
"light": "#1A2B1E"
|
|
113
117
|
},
|
|
114
118
|
"diffRemovedBg": {
|
|
115
119
|
"dark": "#37222c",
|
|
@@ -124,8 +128,8 @@
|
|
|
124
128
|
"light": "darkStep4"
|
|
125
129
|
},
|
|
126
130
|
"diffAddedLineNumberBg": {
|
|
127
|
-
"dark": "#
|
|
128
|
-
"light": "#
|
|
131
|
+
"dark": "#162518",
|
|
132
|
+
"light": "#162518"
|
|
129
133
|
},
|
|
130
134
|
"diffRemovedLineNumberBg": {
|
|
131
135
|
"dark": "#2d1f26",
|
|
@@ -136,52 +140,52 @@
|
|
|
136
140
|
"light": "darkStep12"
|
|
137
141
|
},
|
|
138
142
|
"markdownHeading": {
|
|
139
|
-
"dark": "
|
|
140
|
-
"light": "
|
|
143
|
+
"dark": "darkOrange",
|
|
144
|
+
"light": "darkOrange"
|
|
141
145
|
},
|
|
142
146
|
"markdownLink": {
|
|
143
|
-
"dark": "
|
|
144
|
-
"light": "
|
|
147
|
+
"dark": "darkGreen",
|
|
148
|
+
"light": "darkGreen"
|
|
145
149
|
},
|
|
146
150
|
"markdownLinkText": {
|
|
147
|
-
"dark": "
|
|
148
|
-
"light": "
|
|
151
|
+
"dark": "darkGreen",
|
|
152
|
+
"light": "darkGreen"
|
|
149
153
|
},
|
|
150
154
|
"markdownCode": {
|
|
151
|
-
"dark": "
|
|
152
|
-
"light": "
|
|
155
|
+
"dark": "darkGreenDim",
|
|
156
|
+
"light": "darkGreenDim"
|
|
153
157
|
},
|
|
154
158
|
"markdownBlockQuote": {
|
|
155
159
|
"dark": "darkStep11",
|
|
156
160
|
"light": "darkStep11"
|
|
157
161
|
},
|
|
158
162
|
"markdownEmph": {
|
|
159
|
-
"dark": "
|
|
160
|
-
"light": "
|
|
163
|
+
"dark": "darkOrangeWash",
|
|
164
|
+
"light": "darkOrangeWash"
|
|
161
165
|
},
|
|
162
166
|
"markdownStrong": {
|
|
163
|
-
"dark": "
|
|
164
|
-
"light": "
|
|
167
|
+
"dark": "darkOrangeBright",
|
|
168
|
+
"light": "darkOrangeBright"
|
|
165
169
|
},
|
|
166
170
|
"markdownHorizontalRule": {
|
|
167
171
|
"dark": "darkStep11",
|
|
168
172
|
"light": "darkStep11"
|
|
169
173
|
},
|
|
170
174
|
"markdownListItem": {
|
|
171
|
-
"dark": "
|
|
172
|
-
"light": "
|
|
175
|
+
"dark": "darkOrange",
|
|
176
|
+
"light": "darkOrange"
|
|
173
177
|
},
|
|
174
178
|
"markdownListEnumeration": {
|
|
175
|
-
"dark": "
|
|
176
|
-
"light": "
|
|
179
|
+
"dark": "darkOrange",
|
|
180
|
+
"light": "darkOrange"
|
|
177
181
|
},
|
|
178
182
|
"markdownImage": {
|
|
179
|
-
"dark": "
|
|
180
|
-
"light": "
|
|
183
|
+
"dark": "darkOrange",
|
|
184
|
+
"light": "darkOrange"
|
|
181
185
|
},
|
|
182
186
|
"markdownImageText": {
|
|
183
|
-
"dark": "
|
|
184
|
-
"light": "
|
|
187
|
+
"dark": "darkGreen",
|
|
188
|
+
"light": "darkGreen"
|
|
185
189
|
},
|
|
186
190
|
"markdownCodeBlock": {
|
|
187
191
|
"dark": "darkStep12",
|
|
@@ -192,32 +196,32 @@
|
|
|
192
196
|
"light": "darkStep11"
|
|
193
197
|
},
|
|
194
198
|
"syntaxKeyword": {
|
|
195
|
-
"dark": "
|
|
196
|
-
"light": "
|
|
199
|
+
"dark": "darkOrange",
|
|
200
|
+
"light": "darkOrange"
|
|
197
201
|
},
|
|
198
202
|
"syntaxFunction": {
|
|
199
|
-
"dark": "
|
|
200
|
-
"light": "
|
|
203
|
+
"dark": "darkOrangeBright",
|
|
204
|
+
"light": "darkOrangeBright"
|
|
201
205
|
},
|
|
202
206
|
"syntaxVariable": {
|
|
203
|
-
"dark": "
|
|
204
|
-
"light": "
|
|
207
|
+
"dark": "darkSalmon",
|
|
208
|
+
"light": "darkSalmon"
|
|
205
209
|
},
|
|
206
210
|
"syntaxString": {
|
|
207
|
-
"dark": "
|
|
208
|
-
"light": "
|
|
211
|
+
"dark": "darkGreenDim",
|
|
212
|
+
"light": "darkGreenDim"
|
|
209
213
|
},
|
|
210
214
|
"syntaxNumber": {
|
|
211
|
-
"dark": "
|
|
212
|
-
"light": "
|
|
215
|
+
"dark": "darkOrangeWash",
|
|
216
|
+
"light": "darkOrangeWash"
|
|
213
217
|
},
|
|
214
218
|
"syntaxType": {
|
|
215
|
-
"dark": "
|
|
216
|
-
"light": "
|
|
219
|
+
"dark": "darkGreenBright",
|
|
220
|
+
"light": "darkGreenBright"
|
|
217
221
|
},
|
|
218
222
|
"syntaxOperator": {
|
|
219
|
-
"dark": "
|
|
220
|
-
"light": "
|
|
223
|
+
"dark": "darkGreen",
|
|
224
|
+
"light": "darkGreen"
|
|
221
225
|
},
|
|
222
226
|
"syntaxPunctuation": {
|
|
223
227
|
"dark": "darkStep12",
|