fixed strudel bool

This commit is contained in:
Jade (Rose) Rowland 2025-04-19 16:10:38 -04:00
parent 17e1ebeb93
commit bd08b74ebc
12 changed files with 157 additions and 38 deletions

View File

@ -11,7 +11,9 @@ export const flashField = StateField.define({
for (let e of tr.effects) { for (let e of tr.effects) {
if (e.is(setFlash)) { if (e.is(setFlash)) {
if (e.value && tr.newDoc.length > 0) { if (e.value && tr.newDoc.length > 0) {
const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } }); const mark = Decoration.mark({
attributes: { style: `background-color: rgba(255,255,255, .4); filter: invert(10%)` },
});
flash = Decoration.set([mark.range(0, tr.newDoc.length)]); flash = Decoration.set([mark.range(0, tr.newDoc.length)]);
} else { } else {
flash = Decoration.set([]); flash = Decoration.set([]);

View File

@ -5,16 +5,15 @@ import whitescreen, { settings as whitescreenSettings } from './themes/whitescre
import teletext, { settings as teletextSettings } from './themes/teletext.mjs'; import teletext, { settings as teletextSettings } from './themes/teletext.mjs';
import algoboy, { settings as algoboySettings } from './themes/algoboy.mjs'; import algoboy, { settings as algoboySettings } from './themes/algoboy.mjs';
import CutiePi, { settings as CutiePiSettings } from './themes/CutiePi.mjs'; import CutiePi, { settings as CutiePiSettings } from './themes/CutiePi.mjs';
import terminal, { settings as terminalSettings } from './themes/terminal.mjs'; import sonicPink, { settings as sonicPinkSettings } from './themes/sonic-pink.mjs';
import abcdef, { settings as abcdefSettings } from './themes/abcdef.mjs'; import redText, { settings as redTextSettings } from './themes/red-text.mjs';
import greenText, { settings as greenTextSettings } from './themes/green-text.mjs';
import androidstudio, { settings as androidstudioSettings } from './themes/androidstudio.mjs'; import androidstudio, { settings as androidstudioSettings } from './themes/androidstudio.mjs';
import atomone, { settings as atomOneSettings } from './themes/atomone.mjs'; import atomone, { settings as atomOneSettings } from './themes/atomone.mjs';
import aura, { settings as auraSettings } from './themes/aura.mjs'; import aura, { settings as auraSettings } from './themes/aura.mjs';
import bespin, { settings as bespinSettings } from './themes/bespin.mjs';
import darcula, { settings as darculaSettings } from './themes/darcula.mjs'; import darcula, { settings as darculaSettings } from './themes/darcula.mjs';
import dracula, { settings as draculaSettings } from './themes/dracula.mjs'; import dracula, { settings as draculaSettings } from './themes/dracula.mjs';
import duotoneDark, { settings as duotoneDarkSettings } from './themes/duotoneDark.mjs'; import duotoneDark, { settings as duotoneDarkSettings } from './themes/duotoneDark.mjs';
import duotoneLight, { settings as duotoneLightSettings } from './themes/duotoneLight.mjs';
import eclipse, { settings as eclipseSettings } from './themes/eclipse.mjs'; import eclipse, { settings as eclipseSettings } from './themes/eclipse.mjs';
import githubDark, { settings as githubDarkSettings } from './themes/githubDark.mjs'; import githubDark, { settings as githubDarkSettings } from './themes/githubDark.mjs';
import githubLight, { settings as githubLightSettings } from './themes/githubLight.mjs'; import githubLight, { settings as githubLightSettings } from './themes/githubLight.mjs';
@ -38,46 +37,45 @@ import bbedit, { settings as bbeditSettings } from './themes/bbedit.mjs';
import noctisLilac, { settings as noctisLilacSettings } from './themes/noctisLilac.mjs'; import noctisLilac, { settings as noctisLilacSettings } from './themes/noctisLilac.mjs';
import { setTheme } from '@strudel/draw'; import { setTheme } from '@strudel/draw';
export const themes = { export const themes = {
strudelTheme, strudelTheme,
bluescreen,
blackscreen,
whitescreen,
teletext,
algoboy, algoboy,
androidstudio,
atomone, atomone,
aura, aura,
darcula,
dracula,
// todo: optimize // todo: optimize
// bespin, // bespin,
//abcdef, //abcdef,
androidstudio, bbedit,
duotoneDark, blackscreen,
githubDark, bluescreen,
CutiePi, CutiePi,
darcula,
dracula,
duotoneDark,
eclipse,
githubDark,
githubLight,
greenText,
gruvboxDark, gruvboxDark,
gruvboxLight,
sonicPink,
materialDark, materialDark,
nord, materialLight,
monokai, monokai,
noctisLilac,
nord,
redText,
solarizedDark, solarizedDark,
solarizedLight,
sublime, sublime,
teletext,
tokyoNight, tokyoNight,
tokyoNightDay,
tokyoNightStorm, tokyoNightStorm,
vscodeDark, vscodeDark,
//xcodeDark,
// LIGHT
bbedit,
//duotoneLight,
eclipse,
githubLight,
gruvboxLight,
materialLight,
vscodeLight, vscodeLight,
noctisLilac, whitescreen,
solarizedLight,
tokyoNightDay,
xcodeLight, xcodeLight,
}; };
@ -88,21 +86,19 @@ export const settings = {
whitescreen: whitescreenSettings, whitescreen: whitescreenSettings,
teletext: teletextSettings, teletext: teletextSettings,
algoboy: algoboySettings, algoboy: algoboySettings,
terminal: terminalSettings,
abcdef: abcdefSettings,
androidstudio: androidstudioSettings, androidstudio: androidstudioSettings,
atomone: atomOneSettings, atomone: atomOneSettings,
aura: auraSettings, aura: auraSettings,
bbedit: bbeditSettings, bbedit: bbeditSettings,
bespin: bespinSettings,
darcula: darculaSettings, darcula: darculaSettings,
dracula: draculaSettings, dracula: draculaSettings,
duotoneLight: duotoneLightSettings,
duotoneDark: duotoneDarkSettings, duotoneDark: duotoneDarkSettings,
eclipse: eclipseSettings, eclipse: eclipseSettings,
CutiePi: CutiePiSettings, CutiePi: CutiePiSettings,
sonicPink: sonicPinkSettings,
githubLight: githubLightSettings, githubLight: githubLightSettings,
githubDark: githubDarkSettings, githubDark: githubDarkSettings,
greenText: greenTextSettings,
gruvboxDark: gruvboxDarkSettings, gruvboxDark: gruvboxDarkSettings,
gruvboxLight: gruvboxLightSettings, gruvboxLight: gruvboxLightSettings,
materialDark: materialDarkSettings, materialDark: materialDarkSettings,
@ -110,6 +106,7 @@ export const settings = {
noctisLilac: noctisLilacSettings, noctisLilac: noctisLilacSettings,
nord: nordSettings, nord: nordSettings,
monokai: monokaiSettings, monokai: monokaiSettings,
redText: redTextSettings,
solarizedLight: solarizedLightSettings, solarizedLight: solarizedLightSettings,
solarizedDark: solarizedDarkSettings, solarizedDark: solarizedDarkSettings,
sublime: sublimeSettings, sublime: sublimeSettings,
@ -118,7 +115,6 @@ export const settings = {
vscodeDark: vscodeDarkSettings, vscodeDark: vscodeDarkSettings,
vscodeLight: vscodeLightSettings, vscodeLight: vscodeLightSettings,
xcodeLight: xcodeLightSettings, xcodeLight: xcodeLightSettings,
//xcodeDark: xcodeDarkSettings,
tokyoNightDay: tokyoNightDaySettings, tokyoNightDay: tokyoNightDaySettings,
}; };

View File

@ -54,6 +54,7 @@ export default createTheme({
tag: [t.keyword, t.tagName, t.arithmeticOperator], tag: [t.keyword, t.tagName, t.arithmeticOperator],
color: palette[1], color: palette[1],
}, },
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: palette[0]},
{ tag: [t.function(t.variableName), t.propertyName], color: palette[0] }, { tag: [t.function(t.variableName), t.propertyName], color: palette[0] },
{ tag: t.atom, color: palette[1] }, { tag: t.atom, color: palette[1] },
], ],

View File

@ -38,12 +38,14 @@ export default createTheme({
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
color: 'hsl(207, 82%, 66%)', color: 'hsl(207, 82%, 66%)',
}, },
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: 'hsl( 29, 54%, 61%)'},
{ tag: [t.tagName, t.heading], color: '#e06c75' }, { tag: [t.tagName, t.heading], color: '#e06c75' },
{ tag: t.comment, color: '#54636D' }, { tag: t.comment, color: '#54636D' },
{ tag: [t.variableName, t.propertyName, t.labelName], color: 'hsl(220, 14%, 71%)' }, { tag: [t.variableName, t.propertyName, t.labelName], color: 'hsl(220, 14%, 71%)' },
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' }, { tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' },
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' }, { tag: t.className, color: 'hsl( 39, 67%, 69%)' },
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' }, { tag: t.keyword, color: 'hsl(286, 60%, 67%)' },
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' }, { tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' },
], ],
}); });

View File

@ -0,0 +1,39 @@
/**
* @name Atom One
* Atom One dark syntax theme
*
* https://github.com/atom/one-dark-syntax
*/
import { tags as t } from '@lezer/highlight';
import { createTheme } from './theme-helper.mjs';
const hex = ['#000000', '#8ed675', '#56bd2a', '#54636D', '#171717'];
export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[2],
selection: hex[4],
selectionMatch: hex[0],
gutterBackground: hex[0],
gutterForeground: hex[3],
gutterBorder: 'transparent',
lineHighlight: hex[0],
};
export default createTheme({
theme: 'dark',
settings,
styles: [
{
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
color: hex[2],
},
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[1] },
{ tag: t.comment, color: hex[3] },
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[2] },
{ tag: [t.attributeName, t.number], color: hex[1] },
{ tag: t.keyword, color: hex[2] },
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[1] },
],
});

39
packages/codemirror/themes/red-text.mjs vendored Normal file
View File

@ -0,0 +1,39 @@
/**
* @name Atom One
* Atom One dark syntax theme
*
* https://github.com/atom/one-dark-syntax
*/
import { tags as t } from '@lezer/highlight';
import { createTheme } from './theme-helper.mjs';
const hex = ['#000000', '#ff5356', '#bd312a', '#54636D', '#171717'];
export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[2],
selection: hex[4],
selectionMatch: hex[0],
gutterBackground: hex[0],
gutterForeground: hex[3],
gutterBorder: 'transparent',
lineHighlight: hex[0],
};
export default createTheme({
theme: 'dark',
settings,
styles: [
{
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
color: hex[2],
},
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[1] },
{ tag: t.comment, color: hex[3] },
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[2] },
{ tag: [t.attributeName, t.number], color: hex[1] },
{ tag: t.keyword, color: hex[2] },
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[1] },
],
});

View File

@ -0,0 +1,39 @@
/**
* @name Atom One
* Atom One dark syntax theme
*
* https://github.com/atom/one-dark-syntax
*/
import { tags as t } from '@lezer/highlight';
import { createTheme } from './theme-helper.mjs';
const hex = ['#1e1e1e', '#fbde2d', '#ff1493', '#4c83ff', '#ededed', '#cccccc', '#ffffff30', '#dc2f8c'];
export const settings = {
background: '#000000',
lineBackground: 'transparent',
foreground: hex[4],
selection: hex[6],
gutterBackground: hex[0],
gutterForeground: hex[5],
gutterBorder: 'transparent',
lineHighlight: hex[0],
};
export default createTheme({
theme: 'dark',
settings,
styles: [
{
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
color: hex[4],
},
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[3] },
{ tag: t.comment, color: '#54636D' },
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[4] },
{ tag: [t.attributeName, t.number], color: hex[3] },
{ tag: t.keyword, color: hex[1] },
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[2] },
],
});

View File

@ -5,14 +5,11 @@ export const settings = {
background: '#222', background: '#222',
lineBackground: '#22222299', lineBackground: '#22222299',
foreground: '#fff', foreground: '#fff',
// foreground: '#75baff',
caret: '#ffcc00', caret: '#ffcc00',
selection: 'rgba(128, 203, 196, 0.5)', selection: 'rgba(128, 203, 196, 0.5)',
selectionMatch: '#036dd626', selectionMatch: '#036dd626',
// lineHighlight: '#8a91991a', // original
lineHighlight: '#00000050', lineHighlight: '#00000050',
gutterBackground: 'transparent', gutterBackground: 'transparent',
// gutterForeground: '#8a919966',
gutterForeground: '#8a919966', gutterForeground: '#8a919966',
}; };
@ -20,6 +17,7 @@ export default createTheme({
theme: 'dark', theme: 'dark',
settings, settings,
styles: [ styles: [
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#89ddff'},
{ tag: t.labelName, color: '#89ddff' }, { tag: t.labelName, color: '#89ddff' },
{ tag: t.keyword, color: '#c792ea' }, { tag: t.keyword, color: '#c792ea' },
{ tag: t.operator, color: '#89ddff' }, { tag: t.operator, color: '#89ddff' },

View File

@ -1,7 +1,10 @@
import { EditorView } from '@codemirror/view'; import { EditorView } from '@codemirror/view';
import { tags as t } from '@lezer/highlight';
import { syntaxHighlighting } from '@codemirror/language'; import { syntaxHighlighting } from '@codemirror/language';
import { HighlightStyle } from '@codemirror/language'; import { HighlightStyle } from '@codemirror/language';
export const createTheme = ({ theme, settings, styles }) => { export const createTheme = ({ theme, settings, styles }) => {
const _theme = EditorView.theme( const _theme = EditorView.theme(
{ {

View File

@ -5,7 +5,7 @@ export function SelectInput({ value, options, onChange, onClick, isDisabled }) {
<select <select
disabled={isDisabled} disabled={isDisabled}
onClick={onClick} onClick={onClick}
className="p-2 bg-background rounded-md text-foreground" className="p-2 bg-background rounded-md text-foreground border-foreground"
value={value ?? ''} value={value ?? ''}
onChange={(e) => onChange(e.target.value)} onChange={(e) => onChange(e.target.value)}
> >

View File

@ -20,7 +20,7 @@ function Checkbox({ label, value, onChange, disabled = false }) {
function SelectInput({ value, options, onChange }) { function SelectInput({ value, options, onChange }) {
return ( return (
<select <select
className="p-2 bg-background rounded-md text-foreground" className="p-2 bg-background rounded-md text-foreground border-foreground"
value={value} value={value}
onChange={(e) => onChange(e.target.value)} onChange={(e) => onChange(e.target.value)}
> >

View File

@ -3,7 +3,7 @@ import cx from '@src/cx.mjs';
export function Textbox({ onChange, className, ...inputProps }) { export function Textbox({ onChange, className, ...inputProps }) {
return ( return (
<input <input
className={cx('p-1 bg-background rounded-md my-2 border-foreground', className)} className={cx('p-2 bg-background rounded-md border-foreground text-foreground placeholder-foreground', className)}
onChange={(e) => onChange(e.target.value)} onChange={(e) => onChange(e.target.value)}
{...inputProps} {...inputProps}
/> />