mirror of
https://github.com/enso-org/enso.git
synced 2024-12-30 11:02:03 +03:00
23 lines
589 B
TypeScript
23 lines
589 B
TypeScript
|
// @ts-nocheck
|
||
|
import { getCurrentInstance, ref, type App } from 'vue'
|
||
|
|
||
|
export const isDark = ref(false)
|
||
|
|
||
|
if (!window.__hst_controls_dark) {
|
||
|
// eslint-disable-next-line camelcase
|
||
|
window.__hst_controls_dark = []
|
||
|
}
|
||
|
|
||
|
// There could be multiple instances of the controls lib (in the controls book https://controls.histoire.dev)
|
||
|
window.__hst_controls_dark.push(isDark)
|
||
|
|
||
|
window.__hst_controls_dark_ready?.()
|
||
|
|
||
|
export function createSetupComponent(setup: (app: App) => void) {
|
||
|
return () => {
|
||
|
const app = getCurrentInstance()?.appContext.app
|
||
|
if (app) setup(app)
|
||
|
return null
|
||
|
}
|
||
|
}
|