Adds dynamic quick actions via modules

Introduces a dynamic quick action system, allowing modules to register actions that appear in a floating action button menu.

This provides a flexible way for modules to extend the application's functionality with common tasks like composing notes or initiating payments.
This commit is contained in:
padreug 2025-11-07 16:00:07 +01:00
parent b286a0315d
commit 678ccff694
4 changed files with 219 additions and 83 deletions

View file

@ -1,37 +1,64 @@
import type { App, Component } from 'vue'
import type { RouteRecordRaw } from 'vue-router'
// Quick action interface for modular action buttons
export interface QuickAction {
/** Unique action ID */
id: string
/** Display label for the action */
label: string
/** Lucide icon name */
icon: string
/** Component to render when action is selected */
component: Component
/** Display order (lower = higher priority) */
order?: number
/** Action category (e.g., 'compose', 'wallet', 'utilities') */
category?: string
/** Whether action requires authentication */
requiresAuth?: boolean
}
// Base module plugin interface
export interface ModulePlugin {
/** Unique module name */
name: string
/** Module version */
version: string
/** Required dependencies (other module names) */
dependencies?: string[]
/** Module configuration */
config?: Record<string, any>
/** Install the module */
install(app: App, options?: any): Promise<void> | void
/** Uninstall the module (cleanup) */
uninstall?(): Promise<void> | void
/** Routes provided by this module */
routes?: RouteRecordRaw[]
/** Components provided by this module */
components?: Record<string, Component>
/** Services provided by this module */
services?: Record<string, any>
/** Composables provided by this module */
composables?: Record<string, any>
/** Quick actions provided by this module */
quickActions?: QuickAction[]
}
// Module configuration for app setup