feat: integrate StarLight updates and improve font settings and skin editor loading
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
32
apps/app/src/skin_editor_bridge.js
Normal file
32
apps/app/src/skin_editor_bridge.js
Normal file
@ -0,0 +1,32 @@
|
||||
;(() => {
|
||||
const isEditor =
|
||||
location.origin === 'http://axolotl-skin.localhost' ||
|
||||
(location.protocol === 'axolotl-skin:' && location.host === 'localhost') ||
|
||||
(location.origin === 'http://localhost:5201' &&
|
||||
location.pathname === '/__blockbench_skin__/index.html')
|
||||
if (
|
||||
!isEditor ||
|
||||
window.parent === window ||
|
||||
new URLSearchParams(location.search).get('embed') !== 'skin'
|
||||
)
|
||||
return
|
||||
|
||||
function report(error) {
|
||||
window.parent.postMessage(
|
||||
{ type: 'axolotl-skin-load-error', error: String(error).slice(0, 1000) },
|
||||
'*',
|
||||
)
|
||||
}
|
||||
window.addEventListener('error', (event) => {
|
||||
if (event.message) {
|
||||
if (event.message.startsWith('ResizeObserver loop')) return
|
||||
report(event.message)
|
||||
}
|
||||
})
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
report(event.reason?.message || event.reason)
|
||||
})
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
window.blockbenchBundleReady?.catch((error) => report(error?.message || error))
|
||||
})
|
||||
})()
|
||||
Reference in New Issue
Block a user