@tower_74/cms-app 0.4.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.4.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",
@@ -2,13 +2,22 @@
2
2
  import AdminLayout from '@/layouts/AdminLayout.vue';
3
3
  import { router } from '@inertiajs/vue3';
4
4
 
5
- defineProps<{
6
- plugins: Array<{ key: string; name: string; version: string; enabled: boolean }>;
7
- }>();
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
+ }
8
15
 
9
- // Enabling/disabling persists via the PluginRegistry; the redirect back reflects the new
10
- // state (a plugin's capabilities are gated on enable at boot — ADR-0026).
11
- const toggle = (plugin: { key: string; enabled: boolean }) => {
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) => {
12
21
  router.post(`/admin/plugins/${plugin.key}/${plugin.enabled ? 'disable' : 'enable'}`, {}, { preserveScroll: true });
13
22
  };
14
23
  </script>
@@ -18,31 +27,58 @@ const toggle = (plugin: { key: string; enabled: boolean }) => {
18
27
  <div class="p-6">
19
28
  <h1 class="text-2xl font-semibold">Plugins</h1>
20
29
  <p class="mt-1 text-sm text-muted">
21
- Enable or disable installed plugins. New plugins become available by installing their package; manage them here.
30
+ Plugins available for this site. Installed ones can be enabled or disabled; others show how to install them.
22
31
  </p>
23
32
 
24
- <div v-if="plugins.length" class="mt-6 divide-y divide-border overflow-hidden rounded-lg border border-border">
25
- <div v-for="plugin in plugins" :key="plugin.key" class="flex items-center justify-between gap-4 p-4">
26
- <div>
27
- <div class="font-medium">{{ plugin.name }}</div>
28
- <div class="text-xs text-muted">{{ plugin.key }} · v{{ plugin.version }}</div>
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>
29
77
  </div>
30
- <button
31
- type="button"
32
- class="rounded-md px-3 py-1.5 text-sm font-medium transition"
33
- :class="
34
- plugin.enabled
35
- ? 'bg-accent text-accent-foreground hover:bg-accent/80'
36
- : 'bg-primary text-primary-foreground hover:opacity-90'
37
- "
38
- @click="toggle(plugin)"
39
- >
40
- {{ plugin.enabled ? 'Disable' : 'Enable' }}
41
- </button>
42
78
  </div>
43
79
  </div>
44
80
 
45
- <p v-else class="mt-6 text-sm text-muted">No plugins installed. Install a plugin package to manage it here.</p>
81
+ <p v-else class="mt-6 text-sm text-muted">No plugins in the catalogue.</p>
46
82
  </div>
47
83
  </AdminLayout>
48
84
  </template>