feat(plugins): add actions plugin package

This commit is contained in:
Federico Jaramillo Martinez
2026-05-21 09:31:33 +02:00
parent d693aa06d7
commit fb7903f3cb
20 changed files with 1347 additions and 9 deletions
+40
View File
@@ -0,0 +1,40 @@
import type { PiWebPlugin } from "@jmfederico/pi-web/plugin-api";
import { ACTIONS_CONFIG_PATH } from "./config.js";
import { actionsPanelBadge, defineActionsPanelElement } from "./actionsPanelElement.js";
const plugin: PiWebPlugin = {
apiVersion: 1,
name: "Workspace Actions",
activate: ({ pluginId, html }) => {
defineActionsPanelElement();
return {
contributions: {
actions: [
{
id: "workspace.open-actions",
title: "Open Workspace Actions",
description: `Open the workspace Actions tab. Configure actions in ${ACTIONS_CONFIG_PATH}.`,
group: "Workspace",
enabled: (context) => context.state.selectedWorkspace !== undefined,
run: (context) => {
if (context.state.selectedWorkspace === undefined) return;
context.selectWorkspaceTool(`${pluginId}:workspace.actions`);
},
},
],
workspacePanels: [
{
id: "workspace.actions",
title: "Actions",
order: 40,
badge: ({ workspace }) => actionsPanelBadge(workspace),
render: ({ workspace, openTerminal }) => html`<pi-web-actions-panel .workspace=${workspace} .openTerminal=${openTerminal}></pi-web-actions-panel>`,
},
],
},
};
},
};
export default plugin;