@reblu/site-contracts 1.12.0 → 1.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @reblu/site-contracts
2
2
 
3
+ ## 1.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7a00471: Featured pages per page category (REB-869). `@reblu/site-contracts` adds `PagesListQuery`, the query of `GET /api/site/pages`, including the new `featured` flag. `@reblu/site-client`: `pages.list({ category, featured: true })` returns that category's featured pages (max 3) in the tenant's order, skipping unpublished, deleted or moved pages, and an empty list when nothing is featured; the new `pages.featured(category, { limit?, fallback?, cache? })` helper returns the featured pages, or the category's first `limit` pages in normal order when none are featured, so a landing teaser is never empty. `limit` must be an integer >= 1: above 3 it is clamped to 3; 0, negative, fractional or NaN throw a `RangeError` before any request. Against an API that predates `featured`, the flag is ignored and `pages.featured()` silently degrades to the category's first `limit` pages. `@reblu/site-blocks` adds `PageCardGrid`, the page-card grid `ParentPage` already rendered for its child pages, as a drop-in (`pages`, `pageHref`, `heading`); cards are keyed by category + slug, an empty `heading` renders no `<h2>`. `ParentPage` now renders through it with unchanged markup (including the empty `<h2>` for `childPagesLabel=''`).
8
+
3
9
  ## 1.12.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -132,6 +132,16 @@ may exist in both `tratamientos` and `especialidades`. Consequences for a SITE:
132
132
  legacy slug-only reference **only when that slug is unique** — otherwise
133
133
  `resolved` is `null`. Build the embed's href from `resolved.category`.
134
134
 
135
+ ### Featured pages per category (REB-869)
136
+
137
+ `PagesListQuery` is the query of `GET /api/site/pages`. With `category` set,
138
+ `featured: true` returns that category's featured pages (max 3) in the order
139
+ the tenant chose in nexus, instead of the normal listing. Unpublished,
140
+ deleted or moved pages are skipped; nothing featured → empty `data` (the API
141
+ never falls back). For a teaser that falls back to the category's first pages,
142
+ use `@reblu/site-client`'s `pages.featured(category)` with
143
+ `@reblu/site-blocks`' `PageCardGrid`.
144
+
135
145
  ### Shop — product trust items (REB-858)
136
146
 
137
147
  `ShopConfig.productTrustItems` is the store-wide list of short trust messages
package/dist/index.d.cts CHANGED
@@ -111,6 +111,8 @@ export type PageSlug = { slug: string; type: "SERVICE" | "CUSTOM"; upda
111
111
 
112
112
  export type PageType = "custom" | "service" | "treatments" | "specialties" | "team" | "generic"
113
113
 
114
+ export type PagesListQuery = { type?: ("custom" | "service" | "treatments" | "specialties" | "team" | "generic")[] | undefined; category?: string | undefined; page?: unknown; pageSize?: unknown; sort?: "order" | "-publishedAt" | undefined; featured?: boolean | undefined;}
115
+
114
116
  export type PagesListSort = "order" | "-publishedAt"
115
117
 
116
118
  export type PaginationMeta = { total?: number | undefined; page?: number | undefined; limit?: number | undefined; pages?: number | undefined;}
package/dist/index.d.ts CHANGED
@@ -111,6 +111,8 @@ export type PageSlug = { slug: string; type: "SERVICE" | "CUSTOM"; upda
111
111
 
112
112
  export type PageType = "custom" | "service" | "treatments" | "specialties" | "team" | "generic"
113
113
 
114
+ export type PagesListQuery = { type?: ("custom" | "service" | "treatments" | "specialties" | "team" | "generic")[] | undefined; category?: string | undefined; page?: unknown; pageSize?: unknown; sort?: "order" | "-publishedAt" | undefined; featured?: boolean | undefined;}
115
+
114
116
  export type PagesListSort = "order" | "-publishedAt"
115
117
 
116
118
  export type PaginationMeta = { total?: number | undefined; page?: number | undefined; limit?: number | undefined; pages?: number | undefined;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reblu/site-contracts",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "private": false,
5
5
  "description": "Public, dependency-free TypeScript types for the Reblu SITE API (types only — no Zod, no Prisma at runtime).",
6
6
  "license": "Apache-2.0",