Load Pi Web plugins from server manifest

This commit is contained in:
Federico Jaramillo Martinez
2026-05-10 09:33:01 +02:00
parent 614db739db
commit 125dedf300
8 changed files with 260 additions and 2 deletions
+35
View File
@@ -0,0 +1,35 @@
const { html } = globalThis.piWebPluginApi;
export default {
id: "info",
name: "Info Plugin",
activate: () => ({
actions: [
{
id: "workspace.show-path",
title: "Show Current Workspace Path",
group: "Info",
enabled: (context) => context.state.selectedWorkspace !== undefined,
run: (context) => {
const path = context.state.selectedWorkspace?.path ?? "No workspace selected";
window.alert(path);
},
},
],
workspacePanels: [
{
id: "workspace.info",
title: "Info",
order: 100,
render: (context) => html`
<section class="toolbar"><strong>Info</strong></section>
<section class="viewer">
<p><strong>Workspace</strong></p>
<p class="muted">${context.workspace.label}</p>
<p class="muted">${context.workspace.path}</p>
</section>
`,
},
],
}),
};