From d434b0fd78b4d92cd0c7dae54881f289bc2f69a1 Mon Sep 17 00:00:00 2001 From: bradcypert Date: Tue, 5 Aug 2025 12:00:06 -0400 Subject: [PATCH 1/2] feat(codeplayground): json support --- src/components/CodePlayground/index.stories.tsx | 10 ++++++++++ src/types.ts | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/components/CodePlayground/index.stories.tsx b/src/components/CodePlayground/index.stories.tsx index ab8edea1..88adb344 100644 --- a/src/components/CodePlayground/index.stories.tsx +++ b/src/components/CodePlayground/index.stories.tsx @@ -46,6 +46,16 @@ puts users`, const users = sdk.getUsers() console.log(users)`, }, + json: { + code: `{ + "users": [ + { + "id": 1, + "name": "John Doe" + }, + ] +}`, + }, } export const Default: Story = { diff --git a/src/types.ts b/src/types.ts index 223037b3..171280c4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -87,6 +87,7 @@ export const supportedLanguages = [ 'swift', 'ruby', 'postman', + 'json', ] as const export type SupportedLanguage = (typeof supportedLanguages)[number] @@ -121,6 +122,8 @@ export function prettyLanguageName(language: SupportedLanguage) { return 'Terraform' case 'unity': return 'Unity' + case 'json': + return 'JSON' default: assertNever(language) } From 35ea9c975c331c38775513357c0cef37824a52be Mon Sep 17 00:00:00 2001 From: bradcypert Date: Tue, 5 Aug 2025 12:20:24 -0400 Subject: [PATCH 2/2] add json language svg --- src/assets/icons/languages/json.svg | 2 ++ src/components/TargetLanguageIcon/index.tsx | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 src/assets/icons/languages/json.svg diff --git a/src/assets/icons/languages/json.svg b/src/assets/icons/languages/json.svg new file mode 100644 index 00000000..77333f54 --- /dev/null +++ b/src/assets/icons/languages/json.svg @@ -0,0 +1,2 @@ + +JSON icon \ No newline at end of file diff --git a/src/components/TargetLanguageIcon/index.tsx b/src/components/TargetLanguageIcon/index.tsx index cc04ba62..db4613de 100644 --- a/src/components/TargetLanguageIcon/index.tsx +++ b/src/components/TargetLanguageIcon/index.tsx @@ -12,6 +12,7 @@ import PhpIcon from '@/assets/icons/languages/php.svg?react' import SwiftIcon from '@/assets/icons/languages/swift.svg?react' import RubyIcon from '@/assets/icons/languages/ruby.svg?react' import PostmanIcon from '@/assets/icons/languages/postman.svg?react' +import JSONIcon from '@/assets/icons/languages/json.svg?react' import { cn } from '@/lib/utils' const sizeMap: Record = { @@ -45,6 +46,7 @@ const icons: Record< swift: SwiftIcon, ruby: RubyIcon, postman: PostmanIcon, + json: JSONIcon, } export interface TargetLanguageIconProps {