chore(example): clean up and migrate to ts partially (#3492)

* chore(example): clean up and migrate to ts

* Add missing permissions

* Mirror line-height: 1.5 and remove h-*
This commit is contained in:
Tony
2026-07-16 19:47:52 +08:00
committed by GitHub
parent 40ae0a7fa0
commit d6e0b6bbb1
7 changed files with 224 additions and 188 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
import { arrayBufferToBase64 } from '../lib/utils'
import { onDestroy, onMount } from 'svelte'
const { onMessage, insecureRenderHtml } = $props()
const { onMessage } = $props()
let path = $state('')
let img
@@ -118,12 +118,12 @@
new Uint8Array(response),
function (base64) {
const src = 'data:image/png;base64,' + base64
insecureRenderHtml('<img src="' + src + '"></img>')
onMessage('<img src="' + src + '"></img>')
}
)
} else {
const value = String.fromCharCode.apply(null, response)
insecureRenderHtml(
onMessage(
'<textarea id="file-response"></textarea><button id="file-save">Save</button>'
)
setTimeout(() => {