-
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.
- Loading branch information
1 parent
e73386e
commit 8f7ddc2
Showing
57 changed files
with
523 additions
and
491 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {Asset} from "@type"; | ||
|
||
export function assetToSrc(asset: Asset): string { | ||
return asset.path | ||
|| `data:${asset.media};${asset.encoding},${asset.data}`; | ||
} |
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 +1,3 @@ | ||
export * from "./createLocalStorageSyncSignal"; | ||
export * from "./createLocalStorageSyncSignal"; | ||
export * from "./assetToSrc"; | ||
export * from "./readFile"; |
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,25 @@ | ||
export async function readFile(file: File): Promise<{ | ||
media: string; | ||
encoding: string; | ||
data: string; | ||
}>{ | ||
return await new Promise((resolve, reject) => { | ||
const reader = new FileReader(); | ||
|
||
reader.addEventListener("load", () => { | ||
const {result} = reader; | ||
if (typeof result != "string") throw new Error(""); | ||
|
||
const dataUrl = result.split(/[;:,]/); | ||
resolve({ | ||
media: dataUrl[1], | ||
encoding: dataUrl[2], | ||
data: dataUrl[3], | ||
}); | ||
}); | ||
|
||
reader.addEventListener("error", reject); | ||
|
||
reader.readAsDataURL(file); | ||
}); | ||
} |
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 +1,29 @@ | ||
.AssetCreateDialog {} | ||
.Form { | ||
width: 100%; | ||
height: 100%; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
|
||
input { | ||
padding: 8px; | ||
color: inherit; | ||
|
||
border: 1px solid var(--grey-60); | ||
border-radius: 8px; | ||
outline: none; | ||
} | ||
|
||
textarea { | ||
width: 100%; | ||
height: 10em; | ||
border-radius: 8px; | ||
padding: 8px; | ||
|
||
border: 1px solid var(--grey-60); | ||
box-shadow: none; | ||
outline: none; | ||
} | ||
} | ||
|
Oops, something went wrong.