From 205b92af7b45790029a6f1b4a5d8909021e9f578 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Tue, 25 Nov 2025 13:56:22 +0100 Subject: [PATCH 01/23] feat: Implement button variants and add supporting theme tokens. --- app/components/Extension.vue | 75 +++++++++++++++++++++++++++++++ app/components/Layout/SideBar.vue | 6 +++ app/layouts/default.vue | 13 ++++++ app/stores/UI.js | 7 +++ 4 files changed, 101 insertions(+) create mode 100644 app/components/Extension.vue diff --git a/app/components/Extension.vue b/app/components/Extension.vue new file mode 100644 index 00000000..6b4d68b6 --- /dev/null +++ b/app/components/Extension.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/app/components/Layout/SideBar.vue b/app/components/Layout/SideBar.vue index 31646d89..f9748ccd 100644 --- a/app/components/Layout/SideBar.vue +++ b/app/components/Layout/SideBar.vue @@ -86,6 +86,7 @@ diff --git a/app/plugins/extension.client.js b/app/plugins/extension.client.js new file mode 100644 index 00000000..445b0dd8 --- /dev/null +++ b/app/plugins/extension.client.js @@ -0,0 +1,15 @@ +import { VeaseExtensionAPI } from '../utils/extensionAPI.js' + +/** + * Extension API Plugin + * Initializes the VeaseExtensionAPI and registers it with the app store + */ +export default defineNuxtPlugin(() => { + const appStore = useAppStore() + const extensionAPI = new VeaseExtensionAPI() + + // Register the extension API with the app store + appStore.setExtensionAPI(extensionAPI) + + console.log('[Vease] Extension API initialized') +}) diff --git a/app/plugins/module-globals.client.js b/app/plugins/module-globals.client.js new file mode 100644 index 00000000..1894c6ac --- /dev/null +++ b/app/plugins/module-globals.client.js @@ -0,0 +1,16 @@ +/** + * Module Globals Plugin + * Exposes Vue and Pinia as global references for extensions + */ +import * as Vue from 'vue' +import * as Pinia from 'pinia' + +export default defineNuxtPlugin(() => { + if (import.meta.client) { + // Expose modules globally for extensions + window.__VUE_RUNTIME__ = Vue + window.__PINIA__ = Pinia + + console.log('[Vease] Module globals initialized for extensions') + } +}) diff --git a/app/utils/extensionAPI.js b/app/utils/extensionAPI.js new file mode 100644 index 00000000..e240fd64 --- /dev/null +++ b/app/utils/extensionAPI.js @@ -0,0 +1,79 @@ +/** + * VeaseExtensionAPI + * + * API exposed to extensions for interacting with Vease application + * Provides access to stores, tool registration, and UI interactions + */ +export class VeaseExtensionAPI { + constructor() { + this._uiStore = null + this._hybridViewerStore = null + this._appStore = null + } + + /** + * Get the UI Store + */ + get UIStore() { + if (!this._uiStore) { + this._uiStore = useUIStore() + } + return this._uiStore + } + + /** + * Get the HybridViewer Store + */ + get HybridViewerStore() { + if (!this._hybridViewerStore) { + this._hybridViewerStore = useHybridViewerStore() + } + return this._hybridViewerStore + } + + /** + * Get the App Store (from OpenGeodeWeb-Front) + */ + get AppStore() { + if (!this._appStore) { + this._appStore = useAppStore() + } + return this._appStore + } + + /** + * Register a tool component + * @param {Object} toolDefinition - Tool definition object + * @param {string} toolDefinition.id - Unique tool identifier + * @param {string} toolDefinition.title - Tool display title + * @param {string} toolDefinition.description - Tool description + * @param {string} toolDefinition.iconType - Icon type ('mdi' or 'svg') + * @param {string} toolDefinition.iconSource - Icon source (mdi icon name or svg path) + * @param {Component} toolDefinition.component - Vue component (must be markRaw) + */ + registerTool(toolDefinition) { + if (!toolDefinition.id) { + throw new Error('Tool definition must have an id') + } + if (!toolDefinition.component) { + throw new Error('Tool definition must have a component') + } + + this.UIStore.registerToolComponent(toolDefinition) + } + + /** + * Access to Vue utilities + */ + get vue() { + return { + defineAsyncComponent, + markRaw, + ref, + computed, + watch, + onMounted, + onUnmounted, + } + } +} From 854dedee3c1d6f7a0de3e7a43c44495e44b30898 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Tue, 25 Nov 2025 17:41:42 +0100 Subject: [PATCH 04/23] edit extension component --- app/components/Extension.vue | 551 +++++++++++------------------------ 1 file changed, 165 insertions(+), 386 deletions(-) diff --git a/app/components/Extension.vue b/app/components/Extension.vue index 79d16541..545284fa 100644 --- a/app/components/Extension.vue +++ b/app/components/Extension.vue @@ -1,103 +1,107 @@