Zweiter von zwei Commits (Fundament in e670f13). Neues, frei platzierbares
Button-Objekt auf der Fläche, das per Klick ein zugewiesenes Makro
ausführt (Zuweisung im Inspektor oder per Rechtsklick direkt am Button).
Neues "▶ Makros"-Panel (Liste + Formular, dritter "▶ Ausführen"-Button pro
Zeile) für Anlegen/Bearbeiten/Löschen/Testlauf ohne Canvas-Button.
Beim Live-Testen gefunden und behoben: ADDTABLE/ADDSHEET navigieren als
Nebeneffekt zur eingefügten Tabelle/zum eingefügten Blatt (richtig für
einen Symbolleisten-Klick, überraschend für einen Makro-Lauf im
Hintergrund) — runMacro() sichert und stellt jetzt aktives Blatt/Objekt/
Auswahl nach dem Lauf wieder her. Nebenbei zwei bestehende
"impliziter-Else"-Fehler behoben, die mit einer vierten Objektart zu
echten Fehlerquellen geworden wären (io/json.ts normaliseObject,
CanvasObject.vue Render-Dispatch).
Vollständig live per Playwright End-zu-Ende verifiziert: Makro über das
echte Formular angelegt, per Listen-Button und per Button-Objekt
ausgeführt, Rechtsklick-Zuweisung geprüft, ein absichtlich fehlerhaftes
Makro zeigt einen Fehler-Toast statt abzustürzen — keine Konsolenfehler.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
100 lines
2.8 KiB
Vue
100 lines
2.8 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* Small hand-drawn line-icon set for the toolbar (no icon library/font —
|
|
* consistent with this project's "nothing off the shelf" approach). One
|
|
* shared <svg> shell (24x24, stroke-only) with a name-keyed set of shapes,
|
|
* since every icon needs the exact same viewBox/stroke setup and only the
|
|
* inner geometry differs.
|
|
*/
|
|
export type ToolbarIconName =
|
|
| 'settings'
|
|
| 'undo'
|
|
| 'redo'
|
|
| 'table'
|
|
| 'chart'
|
|
| 'text'
|
|
| 'tag'
|
|
| 'button'
|
|
| 'macro';
|
|
|
|
defineProps<{ name: ToolbarIconName }>();
|
|
</script>
|
|
|
|
<template>
|
|
<svg
|
|
class="ti"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
stroke-width="1.75"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
aria-hidden="true"
|
|
>
|
|
<template v-if="name === 'settings'">
|
|
<line x1="3" y1="6" x2="21" y2="6" />
|
|
<circle cx="9" cy="6" r="2" fill="currentColor" />
|
|
<line x1="3" y1="12" x2="21" y2="12" />
|
|
<circle cx="15" cy="12" r="2" fill="currentColor" />
|
|
<line x1="3" y1="18" x2="21" y2="18" />
|
|
<circle cx="7" cy="18" r="2" fill="currentColor" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'undo'">
|
|
<path d="M7 10 H15 a4 4 0 0 1 0 8 h-3" />
|
|
<polyline points="7 10 11 6" />
|
|
<polyline points="7 10 11 14" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'redo'">
|
|
<path d="M17 10 H9 a4 4 0 0 0 0 8 h3" />
|
|
<polyline points="17 10 13 6" />
|
|
<polyline points="17 10 13 14" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'table'">
|
|
<rect x="3" y="4" width="18" height="16" rx="2" />
|
|
<line x1="3" y1="10" x2="21" y2="10" />
|
|
<line x1="3" y1="16" x2="21" y2="16" />
|
|
<line x1="9" y1="4" x2="9" y2="20" />
|
|
<line x1="15" y1="4" x2="15" y2="20" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'chart'">
|
|
<line x1="4" y1="20" x2="20" y2="20" />
|
|
<rect x="6" y="13" width="3" height="7" />
|
|
<rect x="11" y="9" width="3" height="11" />
|
|
<rect x="16" y="5" width="3" height="15" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'text'">
|
|
<rect x="4" y="4" width="16" height="16" rx="2" />
|
|
<line x1="7" y1="9" x2="17" y2="9" />
|
|
<line x1="7" y1="13" x2="17" y2="13" />
|
|
<line x1="7" y1="17" x2="13" y2="17" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'tag'">
|
|
<polygon points="4,5 14,5 20,11 14,17 4,17" />
|
|
<circle cx="9" cy="9" r="1.6" fill="currentColor" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'button'">
|
|
<rect x="3" y="7" width="18" height="10" rx="3" />
|
|
<polygon points="10,10.5 10,13.5 13,12" fill="currentColor" stroke="none" />
|
|
</template>
|
|
|
|
<template v-else-if="name === 'macro'">
|
|
<polygon points="6,4 20,12 6,20" fill="currentColor" stroke="none" />
|
|
</template>
|
|
</svg>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.ti {
|
|
width: 17px;
|
|
height: 17px;
|
|
display: block;
|
|
}
|
|
</style>
|