bug fixes & improvements & missing features & font loader

This commit is contained in:
2026-04-07 00:36:21 +03:00
parent ad0d2fda0a
commit b6287906a9
50 changed files with 4087 additions and 1843 deletions

View File

@@ -87,14 +87,14 @@ function onKeyDown(e: KeyboardEvent) {
const tag = target?.tagName
const isInput = tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target?.isContentEditable
// Delete / Backspace
if ((e.key === 'Delete' || e.key === 'Backspace') && editorStore.selectedElementId) {
// Delete / Backspace — çoklu seçim desteği
if ((e.key === 'Delete' || e.key === 'Backspace') && editorStore.selectedElementIds.size > 0) {
if (isInput) return
e.preventDefault()
const id = editorStore.selectedElementId
if (id && id !== 'root') {
editorStore.clearSelection()
templateStore.removeElement(id)
const ids = [...editorStore.selectedElementIds]
editorStore.clearSelection()
for (const id of ids) {
if (id !== 'root') templateStore.removeElement(id)
}
}
@@ -114,6 +114,23 @@ function onKeyDown(e: KeyboardEvent) {
e.preventDefault()
templateStore.redo()
}
// Z-Order kısayolları
if ((e.ctrlKey || e.metaKey) && editorStore.selectedElementId && editorStore.selectedElementId !== 'root') {
if (e.key === ']' && e.shiftKey) {
e.preventDefault()
templateStore.bringToFront(editorStore.selectedElementId)
} else if (e.key === ']') {
e.preventDefault()
templateStore.bringForward(editorStore.selectedElementId)
} else if (e.key === '[' && e.shiftKey) {
e.preventDefault()
templateStore.sendToBack(editorStore.selectedElementId)
} else if (e.key === '[') {
e.preventDefault()
templateStore.sendBackward(editorStore.selectedElementId)
}
}
}
// Browser'ın native pinch-zoom'unu editör alanında engelle