refactor(docs): [SITE-03] migrate desktop editor and integrate typed generation

This commit is contained in:
Harvey Zhao committed 2026-09-14 09:25:46 +08:00
1 parent a468cb2c39
commit 2f130c58f1
37 files changed
+1921 -305

No files matched your search

@@ -0,0 +1,34 @@
import { readPreference } from './editor-preferences.ts'
function loadScript(url: string): Promise<void> {
return new Promise((resolve, reject) => {
const script = document.createElement('script')
const clear = () => {
script.onload = null
script.onerror = null
}
script.onload = () => {
clear()
resolve()
}
script.onerror = () => {
clear()
script.remove()
reject(new Error(`Editor bootstrap failed: ${url}`))
}
script.src = url
document.body.appendChild(script)
})
}
async function bootstrap(): Promise<void> {
await loadScript(
readPreference('prod')
? './compiled/artplayer.js'
: './uncompiled/artplayer/index.js',
)
await loadScript('./assets/js/vs/loader.js')
await loadScript('./assets/js/common.js')
}
void bootstrap().catch(error => console.error(error))