Skip to content

Commit 3c4d87a

Browse files
chore: update code editor
1 parent cf30d3b commit 3c4d87a

File tree

4 files changed

+49
-18
lines changed

4 files changed

+49
-18
lines changed

apps/sim/app/(landing)/studio/[slug]/prose-studio.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
/* Code blocks */
6767
.prose-studio pre {
6868
background: #111111;
69-
border: 1px solid #2a2a2a;
70-
border-radius: 5px;
7169
padding: 1.5rem;
7270
overflow-x: auto;
7371
font-size: 0.875rem;
@@ -154,10 +152,11 @@
154152
* - Keywords/imports: #FA4EDF (pink)
155153
* - Strings: #FFCC02 (yellow)
156154
* - Functions/methods: #82aaff (periwinkle)
157-
* - Types/classes: #2ABBF8 (cyan)
155+
* - Types/classes/properties: #2ABBF8 (cyan)
158156
* - Numbers/booleans: #00F701 (green)
159157
* - Comments: #666
160158
* - Operators/punctuation: #999
159+
* - Plain text: #d4d4d8
161160
*/
162161

163162
.token.comment,
@@ -219,6 +218,18 @@
219218
color: #2abbf8;
220219
}
221220

221+
.token.parameter {
222+
color: #d4d4d8;
223+
}
224+
225+
.token.template-string .token.interpolation {
226+
color: #fa4edf;
227+
}
228+
229+
.token.template-string .token.string {
230+
color: #ffcc02;
231+
}
232+
222233
/* Reduced motion */
223234
@media (prefers-reduced-motion: reduce) {
224235
.prose-studio a {

apps/sim/app/(landing)/studio/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export default function StudioLayout({ children }: { children: React.ReactNode }
4949
<StudioSidebar />
5050
<main className='relative flex-1'>{children}</main>
5151
</div>
52-
<Footer />
52+
<div className='border-t border-[#2A2A2A]'>
53+
<Footer />
54+
</div>
5355
</div>
5456
)
5557
}

apps/sim/content/blog/multiplayer/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ Multiplayer workflow building is no longer a technical curiosity—it's how team
178178

179179
---
180180

181-
*Interested in how Sim's multiplayer system works in practice? [Try building a workflow](https://sim.ai) with a collaborator in real-time.*
181+
> Interested in how Sim's multiplayer system works in practice? [Try building a workflow](https://sim.ai) with a collaborator in real-time.

apps/sim/lib/blog/code.tsx

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@ import 'prismjs/components/prism-bash'
1111
import 'prismjs/components/prism-css'
1212
import 'prismjs/components/prism-yaml'
1313
import 'prismjs/components/prism-markdown'
14+
import 'prismjs/components/prism-jsx'
15+
import 'prismjs/components/prism-tsx'
16+
import 'prismjs/components/prism-sql'
17+
import 'prismjs/components/prism-graphql'
18+
import 'prismjs/components/prism-go'
19+
import 'prismjs/components/prism-rust'
20+
import 'prismjs/components/prism-toml'
21+
import 'prismjs/components/prism-diff'
22+
import 'prismjs/components/prism-docker'
1423

1524
interface CodeBlockProps {
1625
code: string
1726
language: string
18-
filename?: string
1927
}
2028

2129
const LANG_MAP: Record<string, string> = {
2230
js: 'javascript',
23-
jsx: 'javascript',
31+
jsx: 'jsx',
2432
ts: 'typescript',
25-
tsx: 'typescript',
33+
tsx: 'tsx',
2634
typescript: 'typescript',
2735
javascript: 'javascript',
2836
json: 'json',
@@ -36,37 +44,47 @@ const LANG_MAP: Record<string, string> = {
3644
yml: 'yaml',
3745
md: 'markdown',
3846
markdown: 'markdown',
39-
markup: 'markup',
4047
html: 'markup',
4148
xml: 'markup',
42-
php: 'php',
43-
rust: 'rust',
49+
sql: 'sql',
50+
graphql: 'graphql',
4451
go: 'go',
45-
java: 'java',
46-
kotlin: 'kotlin',
47-
scala: 'scala',
48-
swift: 'swift',
49-
dart: 'dart',
52+
rust: 'rust',
53+
toml: 'toml',
54+
diff: 'diff',
55+
dockerfile: 'docker',
5056
}
5157

5258
const LANG_LABEL: Record<string, string> = {
5359
javascript: 'JavaScript',
5460
typescript: 'TypeScript',
61+
jsx: 'JSX',
62+
tsx: 'TSX',
5563
json: 'JSON',
5664
python: 'Python',
5765
bash: 'Bash',
5866
css: 'CSS',
67+
html: 'HTML',
5968
yaml: 'YAML',
6069
markdown: 'Markdown',
70+
sql: 'SQL',
71+
graphql: 'GraphQL',
72+
go: 'Go',
73+
rust: 'Rust',
74+
toml: 'TOML',
75+
diff: 'Diff',
76+
dockerfile: 'Dockerfile',
77+
markup: 'HTML',
78+
docker: 'Dockerfile',
6179
}
6280

63-
export function CodeBlock({ code, language, filename }: CodeBlockProps) {
81+
export function CodeBlock({ code, language }: CodeBlockProps) {
6482
const [copied, setCopied] = useState(false)
6583

6684
const lang = LANG_MAP[language.toLowerCase()] || 'javascript'
6785
const grammar = languages[lang] || languages.javascript
6886
const highlighted = highlight(code, grammar, lang)
69-
const label = filename || LANG_LABEL[lang] || language
87+
const label = LANG_LABEL[lang] || LANG_LABEL[language.toLowerCase()] || language || 'Code'
7088

7189
const handleCopy = useCallback(async () => {
7290
try {

0 commit comments

Comments
 (0)