@tower_74/cms-app 0.2.0 → 0.3.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.2.0",
3
+ "version": "0.3.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",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@inertiajs/vue3": "^2.0.0-beta.3",
29
- "@tower_74/cms-ui": "^0.12.0",
29
+ "@tower_74/cms-ui": "^0.13.0",
30
30
  "@vueuse/core": "^12.0.0",
31
31
  "laravel-vite-plugin": "^1.0",
32
32
  "lucide-vue-next": "^0.468.0",
package/src/index.ts CHANGED
@@ -4,9 +4,9 @@ import { cmsPages } from './pages';
4
4
  import { pluginPages } from './plugins';
5
5
 
6
6
  export { initializeTheme } from './composables/useAppearance';
7
- export { cmsPages };
8
7
  export { pluginBlocks, pluginIcons, registerCmsPlugins } from './plugins';
9
8
  export type { CmsPlugin } from './plugins';
9
+ export { cmsPages };
10
10
 
11
11
  type PageGlob = Record<string, () => Promise<unknown>>;
12
12
 
@@ -79,8 +79,7 @@ const can = computed(() => (page.props.auth as { can?: Record<string, boolean> }
79
79
  // `adminNav` with a lucide icon *name* the plugin's front end resolves (fallback: Box).
80
80
  const pluginNav = computed<NavItem[]>(() => {
81
81
  const icons = pluginIcons();
82
- const items =
83
- (page.props.adminNav as Array<{ label: string; href: string; icon: string | null; permission: string | null }> | undefined) ?? [];
82
+ const items = (page.props.adminNav as Array<{ label: string; href: string; icon: string | null; permission: string | null }> | undefined) ?? [];
84
83
 
85
84
  return items.map((item) => ({
86
85
  label: item.label,
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import AuthBar from '@/components/AuthBar.vue';
3
+ import { pluginBlocks } from '@/plugins';
3
4
  import { type Block, BlockRenderer } from '@tower_74/cms-ui';
4
5
  import { computed } from 'vue';
5
6
 
@@ -46,7 +47,7 @@ const showName = computed(() => !props.site.logo || props.site.showName);
46
47
  </main>
47
48
 
48
49
  <footer class="border-t border-border bg-surface">
49
- <BlockRenderer v-if="footerWidgets.length" :blocks="footerWidgets" />
50
+ <BlockRenderer v-if="footerWidgets.length" :blocks="footerWidgets" :components="pluginBlocks()" />
50
51
  <div class="mx-auto max-w-6xl px-4 py-6 text-sm text-muted sm:px-6">© {{ year }} {{ site.name }}</div>
51
52
  </footer>
52
53
  </div>
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { pluginBlocks } from '@/plugins';
2
3
  import { Link } from '@inertiajs/vue3';
3
4
  import { type Block, Button, LandingPageTemplate } from '@tower_74/cms-ui';
4
5
 
@@ -19,7 +20,7 @@ defineProps<{
19
20
  </Link>
20
21
  </div>
21
22
 
22
- <LandingPageTemplate v-if="blocks.length" :blocks="blocks" />
23
+ <LandingPageTemplate v-if="blocks.length" :blocks="blocks" :components="pluginBlocks()" />
23
24
  <p v-else class="px-4 py-20 text-center text-muted">This page has no blocks yet. Add some in the editor.</p>
24
25
  </div>
25
26
  </template>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import Seo from '@/components/Seo.vue';
3
3
  import PublicLayout from '@/layouts/PublicLayout.vue';
4
+ import { pluginBlocks } from '@/plugins';
4
5
  import { router } from '@inertiajs/vue3';
5
6
  import { type Block, BlockRenderer, ProductOverview } from '@tower_74/cms-ui';
6
7
 
@@ -41,6 +42,6 @@ const addToCart = (payload: { variantId: number | string; quantity: number }) =>
41
42
  @add-to-cart="addToCart"
42
43
  />
43
44
 
44
- <BlockRenderer v-if="product.blocks.length" :blocks="product.blocks" />
45
+ <BlockRenderer v-if="product.blocks.length" :blocks="product.blocks" :components="pluginBlocks()" />
45
46
  </PublicLayout>
46
47
  </template>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import Seo from '@/components/Seo.vue';
3
3
  import PublicLayout from '@/layouts/PublicLayout.vue';
4
+ import { pluginBlocks } from '@/plugins';
4
5
  import { type Block, DetailPageTemplate, LandingPageTemplate } from '@tower_74/cms-ui';
5
6
 
6
7
  defineProps<{
@@ -29,13 +30,13 @@ defineProps<{
29
30
  <div v-if="page.showTitle" class="mx-auto max-w-6xl px-4 pb-2 pt-10 sm:px-6">
30
31
  <h1 class="text-3xl font-bold tracking-tight text-text">{{ page.title }}</h1>
31
32
  </div>
32
- <LandingPageTemplate :blocks="page.blocks" />
33
+ <LandingPageTemplate :blocks="page.blocks" :components="pluginBlocks()" />
33
34
  </template>
34
35
  <template v-else>
35
36
  <div v-if="page.featuredImage" class="mx-auto max-w-3xl px-4 pt-8 sm:px-6">
36
37
  <img :src="page.featuredImage.src" :alt="page.featuredImage.alt ?? ''" class="w-full rounded-lg object-cover" />
37
38
  </div>
38
- <DetailPageTemplate :header="page.header" :blocks="page.blocks" />
39
+ <DetailPageTemplate :header="page.header" :blocks="page.blocks" :components="pluginBlocks()" />
39
40
  </template>
40
41
  </PublicLayout>
41
42
  </template>