Frontend uudelleenrakennettu: Astro-komponentit, Wasm pääsäikeessä, ei Workeria

Vanha frontend siirretty temp/. Uusi rakenne:
- StatusBar.astro, Terminal.astro, Editor.astro, Guide.astro
- global.css erillinen
- Wasm pääsäikeessä (ei Worker — yksinkertainen, debugattava)
- Tab-completion, dropdown, projektikortti, Monaco, GUIDE.md
- Ei tokenisointia eikä koodilaboratoriota

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaakko Vanhala
2026-04-09 20:17:39 +03:00
parent e3fdb91ac5
commit a8c4af0975
9617 changed files with 996171 additions and 5349 deletions

View File

@@ -0,0 +1,68 @@
import { defineDriver } from "./utils/index.mjs";
import { normalizeKey } from "./utils/index.mjs";
const OVERLAY_REMOVED = "__OVERLAY_REMOVED__";
const DRIVER_NAME = "overlay";
export default defineDriver((options) => {
return {
name: DRIVER_NAME,
options,
async hasItem(key, opts) {
for (const layer of options.layers) {
if (await layer.hasItem(key, opts)) {
if (layer === options.layers[0] && await options.layers[0]?.getItem(key) === OVERLAY_REMOVED) {
return false;
}
return true;
}
}
return false;
},
async getItem(key) {
for (const layer of options.layers) {
const value = await layer.getItem(key);
if (value === OVERLAY_REMOVED) {
return null;
}
if (value !== null) {
return value;
}
}
return null;
},
// TODO: Support native meta
// async getMeta (key) {},
async setItem(key, value, opts) {
await options.layers[0]?.setItem?.(key, value, opts);
},
async removeItem(key, opts) {
await options.layers[0]?.setItem?.(key, OVERLAY_REMOVED, opts);
},
async getKeys(base, opts) {
const allKeys = await Promise.all(
options.layers.map(async (layer) => {
const keys = await layer.getKeys(base, opts);
return keys.map((key) => normalizeKey(key));
})
);
const uniqueKeys = [...new Set(allKeys.flat())];
const existingKeys = await Promise.all(
uniqueKeys.map(async (key) => {
if (await options.layers[0]?.getItem(key) === OVERLAY_REMOVED) {
return false;
}
return key;
})
);
return existingKeys.filter(Boolean);
},
async dispose() {
await Promise.all(
options.layers.map(async (layer) => {
if (layer.dispose) {
await layer.dispose();
}
})
);
}
};
});