diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2026-01-04 21:47:21 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2026-01-04 21:52:40 -0800 |
| commit | 7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1 (patch) | |
| tree | 5f6d06d94d14d1c03996a0f517d5d3e86204996b /src/ts/editor-standalone.ts | |
| parent | b449f76bc3f36525f37634a5d93f405b155f86d8 (diff) | |
| download | adelie-7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1.tar.gz adelie-7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1.zip | |
Don't open serve
Diffstat (limited to 'src/ts/editor-standalone.ts')
| -rw-r--r-- | src/ts/editor-standalone.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ts/editor-standalone.ts b/src/ts/editor-standalone.ts index 2c8ec81..2d4eab8 100644 --- a/src/ts/editor-standalone.ts +++ b/src/ts/editor-standalone.ts @@ -36,7 +36,7 @@ const adelieEditor = { // Listen for theme changes const observer = new MutationObserver((mutations) => { - mutations.forEach((mutation) => { + for (const mutation of mutations) { if (mutation.attributeName === 'data-theme') { const newTheme = document.documentElement.getAttribute('data-theme') === 'dark' @@ -44,7 +44,7 @@ const adelieEditor = { : 'light'; setEditorTheme(view, newTheme); } - }); + } }); observer.observe(document.documentElement, { @@ -66,9 +66,10 @@ const adelieEditor = { setTheme: setEditorTheme, }; -// Export to window +// Export to window and as default if (typeof window !== 'undefined') { - (window as any).adelieEditor = adelieEditor; + (window as unknown as Record<string, unknown>).adelieEditor = adelieEditor; } +// Also export for module systems export default adelieEditor; |
