@tower_74/cms-app 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tower_74/cms-app",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Front-end app shell for the Base CMS — Inertia/Vue pages, layouts, components and composables. Ships source; consumed by client sites as a versioned dependency (ADR-0023) and overridable per site.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -29,6 +29,7 @@ import {
29
29
  ListOrdered,
30
30
  Menu,
31
31
  Paintbrush,
32
+ Puzzle,
32
33
  Settings,
33
34
  ShoppingBag,
34
35
  Tag,
@@ -60,6 +61,7 @@ const nav: NavItem[] = [
60
61
  { label: 'Theme', href: '/admin/appearance/theme', icon: Paintbrush, permission: 'theme' },
61
62
  { label: 'Widgets', href: '/admin/appearance/widgets', icon: LayoutGrid, permission: 'widgets' },
62
63
  { label: 'Settings', href: '/admin/settings', icon: Settings, permission: 'settings' },
64
+ { label: 'Plugins', href: '/admin/plugins', icon: Puzzle, permission: 'plugins' },
63
65
  ];
64
66
 
65
67
  const page = usePage();
@@ -0,0 +1,84 @@
1
+ <script setup lang="ts">
2
+ import AdminLayout from '@/layouts/AdminLayout.vue';
3
+ import { router } from '@inertiajs/vue3';
4
+
5
+ interface PluginItem {
6
+ key: string;
7
+ name: string;
8
+ description: string | null;
9
+ composer: string | null;
10
+ npm: string | null;
11
+ installed: boolean;
12
+ enabled: boolean;
13
+ version: string | null;
14
+ }
15
+
16
+ defineProps<{ plugins: PluginItem[] }>();
17
+
18
+ // Enable/disable persists via the PluginRegistry; the redirect back reflects the new state
19
+ // (a plugin's capabilities are gated on enable at boot — ADR-0026).
20
+ const toggle = (plugin: PluginItem) => {
21
+ router.post(`/admin/plugins/${plugin.key}/${plugin.enabled ? 'disable' : 'enable'}`, {}, { preserveScroll: true });
22
+ };
23
+ </script>
24
+
25
+ <template>
26
+ <AdminLayout>
27
+ <div class="p-6">
28
+ <h1 class="text-2xl font-semibold">Plugins</h1>
29
+ <p class="mt-1 text-sm text-muted">
30
+ Plugins available for this site. Installed ones can be enabled or disabled; others show how to install them.
31
+ </p>
32
+
33
+ <div v-if="plugins.length" class="mt-6 space-y-3">
34
+ <div v-for="plugin in plugins" :key="plugin.key" class="rounded-lg border border-border p-4">
35
+ <div class="flex items-start justify-between gap-4">
36
+ <div class="min-w-0">
37
+ <div class="flex items-center gap-2">
38
+ <span class="font-medium">{{ plugin.name }}</span>
39
+ <span
40
+ class="rounded-full border px-2 py-0.5 text-xs font-medium"
41
+ :class="
42
+ plugin.enabled
43
+ ? 'border-success text-success'
44
+ : plugin.installed
45
+ ? 'border-border text-muted'
46
+ : 'border-info text-info'
47
+ "
48
+ >
49
+ {{ plugin.enabled ? 'Enabled' : plugin.installed ? 'Disabled' : 'Available' }}
50
+ </span>
51
+ </div>
52
+ <p v-if="plugin.description" class="mt-1 text-sm text-muted">{{ plugin.description }}</p>
53
+ <p class="mt-0.5 text-xs text-muted">
54
+ {{ plugin.key }}<span v-if="plugin.version"> · v{{ plugin.version }}</span>
55
+ </p>
56
+ </div>
57
+
58
+ <button
59
+ v-if="plugin.installed"
60
+ type="button"
61
+ class="shrink-0 rounded-md px-3 py-1.5 text-sm font-medium transition"
62
+ :class="
63
+ plugin.enabled
64
+ ? 'bg-accent text-accent-foreground hover:bg-accent/80'
65
+ : 'bg-primary text-primary-foreground hover:opacity-90'
66
+ "
67
+ @click="toggle(plugin)"
68
+ >
69
+ {{ plugin.enabled ? 'Disable' : 'Enable' }}
70
+ </button>
71
+ </div>
72
+
73
+ <div v-if="!plugin.installed && plugin.composer" class="mt-3 rounded-md border border-border bg-card p-3 text-xs">
74
+ <p class="mb-1 font-medium text-muted">Install, then it'll appear here to enable:</p>
75
+ <pre class="overflow-x-auto text-muted"><code>composer require {{ plugin.composer }}<template v-if="plugin.npm">
76
+ npm install {{ plugin.npm }}</template></code></pre>
77
+ </div>
78
+ </div>
79
+ </div>
80
+
81
+ <p v-else class="mt-6 text-sm text-muted">No plugins in the catalogue.</p>
82
+ </div>
83
+ </AdminLayout>
84
+ </template>