AI slop
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m20s

This commit is contained in:
2026-06-08 00:28:29 +02:00
parent 94e2b8bd47
commit 0fb4f01892
22 changed files with 1474 additions and 346 deletions

View File

@@ -0,0 +1,54 @@
import { ref } from 'vue';
const actions = ref([]);
function register(action) {
if (!action.id || !action.execute) {
console.warn('[ActionRegistry] Action missing id or execute:', action);
return;
}
const existingIndex = actions.value.findIndex(a => a.id === action.id);
if (existingIndex !== -1) {
actions.value[existingIndex] = action;
} else {
actions.value.push(action);
}
}
function unregister(id) {
actions.value = actions.value.filter(a => a.id !== id);
}
function search(query) {
if (!query || query.trim() === '') return [];
const q = query.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim();
if (q === '') return [];
return actions.value.filter(action => {
if (typeof action.isActive === 'function' && !action.isActive()) {
return false;
}
const label = (action.label || '').normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
const description = (action.description || '').normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
return label.includes(q) || description.includes(q);
}).sort((a, b) => {
const aLabel = (a.label || '').toLowerCase();
const bLabel = (b.label || '').toLowerCase();
const qLower = q;
const aStarts = aLabel.startsWith(qLower) ? 0 : 1;
const bStarts = bLabel.startsWith(qLower) ? 0 : 1;
return aStarts - bStarts || aLabel.localeCompare(bLabel);
});
}
function execute(id, params = {}) {
const action = actions.value.find(a => a.id === id);
if (action && action.execute) {
action.execute(params);
}
}
export { register, unregister, search, execute };
export default { register, unregister, search, execute };

View File

@@ -94,7 +94,7 @@ const linkExtension = {
},
renderer(token) {
return `<span class="vue-link" data-href="${token.link}"></span>`;
return `<span class="vue-link" data-href="${token.link}">Link</span>`;
},
};

View File

@@ -34,6 +34,18 @@ const defWindows = {
component: () => import('~/components/windows/CreateCampaignWindow.vue'),
close: () => ClearWindow({type: 'create_campaign'}),
movable: true
},
rename_note: {
title: "Rename Note",
component: () => import('~/components/windows/RenameNoteWindow.vue'),
close: () => ClearWindow({type: 'rename_note'}),
movable: true
},
new_folder: {
title: "New Folder",
component: () => import('~/components/windows/NewFolderWindow.vue'),
close: () => ClearWindow({type: 'new_folder'}),
movable: true
}
}

View File

@@ -189,6 +189,7 @@ function GetPosition(id) {
function ResetPosition(id, pos) {
let win = GetWindowWithId(id);
if (!win) return;
let data = { x: win.x, y: win.y };
if (data.x && data.y) {