Remove editor instances concept and clean up JS interop code

This commit is contained in:
Keavon Chambers
2024-04-29 04:17:09 -07:00
parent 597c96a7db
commit 19eb6ce0ab
25 changed files with 256 additions and 325 deletions
+7 -7
View File
@@ -130,15 +130,15 @@
}
function toggleLayerVisibility(id: bigint) {
editor.instance.toggleLayerVisibility(id);
editor.handle.toggleLayerVisibility(id);
}
function toggleLayerLock(id: bigint) {
editor.instance.toggleLayerLock(id);
editor.handle.toggleLayerLock(id);
}
function handleExpandArrowClick(id: bigint) {
editor.instance.toggleLayerExpansion(id);
editor.handle.toggleLayerExpansion(id);
}
async function onEditLayerName(listing: LayerListingInfo) {
@@ -164,7 +164,7 @@
layers = layers;
const name = (e.target instanceof HTMLInputElement && e.target.value) || "";
editor.instance.setLayerName(listing.entry.id, name);
editor.handle.setLayerName(listing.entry.id, name);
listing.entry.name = name;
}
@@ -196,11 +196,11 @@
// Don't select while we are entering text to rename the layer
if (listing.editingName) return;
editor.instance.selectLayer(listing.entry.id, accel, shift);
editor.handle.selectLayer(listing.entry.id, accel, shift);
}
async function deselectAllLayers() {
editor.instance.deselectAllLayers();
editor.handle.deselectAllLayers();
}
function isNestingLayer(layerClassification: LayerClassification) {
@@ -322,7 +322,7 @@
const { select, insertParentId, insertIndex } = draggingData;
select?.();
editor.instance.moveLayerInTree(insertParentId, insertIndex);
editor.handle.moveLayerInTree(insertParentId, insertIndex);
}
draggingData = undefined;
fakeHighlight = undefined;