-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add download functionality and integrate solid-select component
- Loading branch information
Showing
14 changed files
with
226 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
import { compile_and_run } from "./compile_and_run"; | ||
import { compile_and_run, download } from "./compile_and_run"; | ||
|
||
export const Button = () => { | ||
export const RunButton = () => { | ||
return ( | ||
<button | ||
type="button" | ||
onClick={() => { | ||
console.log("button clicked"); | ||
console.log("run button clicked"); | ||
compile_and_run(); | ||
}} | ||
class="text-2xl text-green-700 text-center py-20" | ||
class="text-2xl text-green-700" | ||
> | ||
Compile and Run | ||
</button> | ||
); | ||
}; | ||
|
||
export const DownloadButton = () => { | ||
return ( | ||
<button | ||
type="button" | ||
onClick={() => { | ||
console.log("download button clicked"); | ||
download("/tmp/main.wasm"); | ||
}} | ||
class="text-2xl text-green-700" | ||
> | ||
Download file | ||
</button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
.custom { | ||
&.solid-select-container { | ||
color: #fa7f25; | ||
} | ||
.solid-select-control { | ||
border-color: #fca560; | ||
&:focus-within { | ||
outline-color: #fca560; | ||
} | ||
} | ||
.solid-select-placeholder { | ||
color: #fca560; | ||
} | ||
.solid-select-option { | ||
&:hover { | ||
background-color: #fa7f25; | ||
color: #fff; | ||
} | ||
&[data-focused="true"] { | ||
background-color: #fca560; | ||
color: #fff; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import * as monaco from 'monaco-editor'; | ||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'; | ||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'; | ||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'; | ||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'; | ||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'; | ||
import * as monaco from "monaco-editor"; | ||
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker"; | ||
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker"; | ||
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker"; | ||
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker"; | ||
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker"; | ||
|
||
// @ts-ignore | ||
self.MonacoEnvironment = { | ||
// biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||
getWorker(_: any, label: string) { | ||
if (label === 'json') { | ||
return new jsonWorker(); | ||
} | ||
if (label === 'css' || label === 'scss' || label === 'less') { | ||
return new cssWorker(); | ||
} | ||
if (label === 'html' || label === 'handlebars' || label === 'razor') { | ||
return new htmlWorker(); | ||
} | ||
if (label === 'typescript' || label === 'javascript') { | ||
return new tsWorker(); | ||
} | ||
return new editorWorker(); | ||
} | ||
// biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||
getWorker(_: any, label: string) { | ||
if (label === "json") { | ||
return new jsonWorker(); | ||
} | ||
if (label === "css" || label === "scss" || label === "less") { | ||
return new cssWorker(); | ||
} | ||
if (label === "html" || label === "handlebars" || label === "razor") { | ||
return new htmlWorker(); | ||
} | ||
if (label === "typescript" || label === "javascript") { | ||
return new tsWorker(); | ||
} | ||
return new editorWorker(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export const triples = [ | ||
"aarch64-unknown-linux-gnu", | ||
"aarch64-unknown-linux-musl", | ||
"arm-unknown-linux-gnueabi", | ||
"arm-unknown-linux-gnueabihf", | ||
"arm-unknown-linux-musleabi", | ||
"arm-unknown-linux-musleabihf", | ||
"armv7-unknown-linux-gnueabihf", | ||
"i586-unknown-linux-gnu", | ||
"i686-unknown-linux-gnu", | ||
"i686-unknown-linux-musl", | ||
"loongarch64-unknown-linux-gnu", | ||
"loongarch64-unknown-linux-musl", | ||
"powerpc-unknown-linux-gnu", | ||
"powerpc64-unknown-linux-gnu", | ||
"powerpc64le-unknown-linux-gnu", | ||
"riscv64gc-unknown-linux-gnu", | ||
"riscv64gc-unknown-linux-musl", | ||
"s390x-unknown-linux-gnu", | ||
"sparcv9-sun-solaris", | ||
"wasm32-wasip1-threads", | ||
"wasm32-wasip1", | ||
"x86_64-pc-windows-gnu", | ||
"x86_64-unknown-freebsd", | ||
"x86_64-unknown-illumos", | ||
"x86_64-unknown-linux-gnu", | ||
"x86_64-unknown-linux-musl", | ||
"x86_64-unknown-netbsd", | ||
"aarch64-pc-windows-msvc", | ||
"i686-pc-windows-gnu", | ||
"i686-pc-windows-msvc", | ||
"x86_64-pc-windows-msvc", | ||
"aarch64-apple-darwin", | ||
"x86_64-apple-darwin", | ||
]; |
Oops, something went wrong.