@reblu/site-blocks 0.31.0 → 0.33.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,35 @@
1
1
  # @reblu/site-blocks
2
2
 
3
+ ## 0.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8c2e641: REB-1236: the order confirmation screen says what happens next for each purchase type.
8
+ - `@reblu/site-contracts`: `ShopOrder.purchaseTexts?: ShopOrderPurchaseText[]` (`{ kind: 'shipping' | 'pickup' | 'digital' | 'service', label, text }`), one entry per purchase type in the order, with the shop's texts from nexus or their Spanish defaults. Optional: older servers do not send it.
9
+ - `@reblu/site-blocks`: `OrderConfirmation` renders `order.purchaseTexts` under a confirmed order, with no extra wiring. New optional prop `showPurchaseTexts` (default `true`). An order without the field renders as before.
10
+
11
+ - fb9bfcc: REB-1236 follow-up: the pickup block of the order confirmation names the pickup point.
12
+ - `@reblu/site-contracts`: `ShopOrderPurchaseText.place?: { name, address: string[] }`, sent on the `pickup` entry with the pickup point frozen on the order (the same name and address lines as the confirmation email). Optional: absent on other kinds and on older servers.
13
+ - `@reblu/site-blocks`: `OrderConfirmation` shows that name and address in the pickup block, with no extra wiring.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [8c2e641]
18
+ - Updated dependencies [fb9bfcc]
19
+ - @reblu/site-contracts@1.31.0
20
+
21
+ ## 0.32.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 93143eb: Reviews (REB-1272). `@reblu/site-contracts` exports the `Review` and `ReviewSource` types of `GET /api/site/reviews`. `@reblu/site-client` adds `client.reviews.list({ pageId?, limit? }, cache?)`: the tenant's published reviews in the order set in nexus, optionally only one page's (404 without the tenant's `reviews` module). `@reblu/site-blocks` adds `Reviews`, a Server Component drop-in: a responsive grid with an accessible star rating, the author, the date, the text and a «Ver en <fuente>» link to the original (new tab, `rel="noopener nofollow"`), plus an optional tenant `notice` above or below the grid. Every existing export and namespace is unchanged.
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [25a6af3]
30
+ - Updated dependencies [93143eb]
31
+ - @reblu/site-contracts@1.30.0
32
+
3
33
  ## 0.31.0
4
34
 
5
35
  ### Minor Changes
package/README.md CHANGED
@@ -36,6 +36,7 @@ colour on the red background. See `docs/theming/theming.md`.
36
36
  | `ProductTrustItems`, `DEFAULT_TRUST_ICONS` | `.` | Store-wide trust messages from `ShopConfig.productTrustItems`. Server Component. See "Product trust items" below. |
37
37
  | `TrustBadges`, `DEFAULT_TRUST_BADGE_HEADINGS` | `.` | The tenant's trust badges from `client.trustBadges.list()`, grouped by type. Server Component. See "Trust badges" below. |
38
38
  | `ArbitrationBadge` | `.` | The consumer-arbitration distinctive with its adhesion number, for the footer. Server Component. See "Consumer arbitration badge" below. |
39
+ | `Reviews` | `.` | The tenant's published, verifiable reviews from `client.reviews.list()`. Server Component. See "Reviews" below. |
39
40
  | `buildFaqPageJsonLd`, `collectFaqItems` | `./seo` | schema.org `FAQPage` structured data. Directive-free (also on `.`). See "Page blocks" below. |
40
41
  | `useCollection` | `./client` | Headless filterable/sortable/paginated collection hook (facets, category, tag, search). Serves both page and blog indexes. |
41
42
  | `Collection` | `./client` | Token-driven presentational grid over `useCollection`. |
@@ -333,7 +334,7 @@ for the wiring steps and a full example app).
333
334
  | `CartSummary` | `.` | `subtotal`, `discount?`, `autoDiscount?`, `shipping?`, `shippingEnabled?`, `total`, `notice?` | Yes |
334
335
  | `CheckoutLoginPrompt` | `.` | `open`, `email`, `onEmailChange`, `onClose`, `onSubmitEmail`, `onContinueAsGuest` | Yes (renders `null` when `open` is false) |
335
336
  | `CheckoutForm` | `.` | `contact`, `onContactChange`, `discountCode`, `onDiscountCodeChange`, `onApplyDiscount`, `onRemoveDiscount`, `onSubmit`, `autoDiscount?` | Yes |
336
- | `OrderConfirmation` | `.` | `status`, `order`, `cartHref?`, `onRecheck?` | Yes |
337
+ | `OrderConfirmation` | `.` | `status`, `order`, `cartHref?`, `onRecheck?`, `showPurchaseTexts?` | Yes |
337
338
  | `OrderInvoiceLink` | `.` | `invoice` (`order.invoice`), `labels?` | Yes (renders `null` without an invoice) |
338
339
  | `FullInvoiceFields` | `.` | `value`, `onChange`, `overCap`, `errors?`, `countries?`, `labels?` | Yes (controlled, no hooks) |
339
340
 
@@ -603,6 +604,29 @@ shown instead of a raw placeholder. A SITE that passes its own
603
604
  `labels.foundDescription` is unaffected: a text without `{email}` keeps the
604
605
  confirmation-email line, exactly as before.
605
606
 
607
+ **REB-1236 — what happens next, per purchase type.** The order lookup
608
+ carries `order.purchaseTexts: Array<{ kind, label, text }>`: one entry per
609
+ purchase type in the order (`shipping`, `pickup`, `digital`, `service`; a
610
+ mixed order gets one each, delivery first). `label` is the shop's checkout
611
+ label for that type and `text` the shop's own text from nexus › Tienda ›
612
+ Configuración › Confirmación, or its Spanish default. `OrderConfirmation`
613
+ renders them under a confirmed order (`paid`/`found`/`timeout`) with no extra
614
+ wiring; the SITE writes no copy of its own:
615
+
616
+ ```tsx
617
+ const { status, order, recheck } = useShopOrderStatus(sessionId)
618
+
619
+ // The per-type texts appear on their own. Pass showPurchaseTexts={false} to hide them.
620
+ <OrderConfirmation status={status} order={order} sessionId={sessionId} onRecheck={recheck} />
621
+ ```
622
+
623
+ The `pickup` entry also carries `place: { name, address }`, the pickup point
624
+ frozen on the order, and the block shows it above the text (the same lines as
625
+ the confirmation email).
626
+
627
+ A server older than REB-1236 sends no `purchaseTexts`, and the screen renders
628
+ as before.
629
+
606
630
  Every title/description is overridable via `labels` (see
607
631
  `OrderConfirmationLabels`). See `@reblu/site-next`'s README
608
632
  "`useShopOrderStatus` — the order-confirmation flow" for the full wiring
@@ -927,6 +951,56 @@ import { Truck } from 'my-icon-set'
927
951
  `icons` cannot add a new icon key: an item whose `icon` this version does not
928
952
  know is still skipped.
929
953
 
954
+ ## Reviews
955
+
956
+ `Reviews` (REB-1272) renders the tenant's published reviews, managed in nexus
957
+ («Reseñas») and served by `client.reviews.list()`: a responsive grid of cards
958
+ with the stars, the text, the author, the date and a «Ver en Google» link to
959
+ the original review. Publishing, hiding or reordering a review in nexus changes
960
+ the SITE on the next revalidation, with no deploy.
961
+
962
+ ```tsx
963
+ import { Reviews } from '@reblu/site-blocks'
964
+
965
+ export async function HomeReviews() {
966
+ const { data: reviews } = await client.reviews
967
+ .list({ limit: 6 }, { revalidate: 3600 })
968
+ .catch(() => ({ data: [] }))
969
+ return (
970
+ <Reviews
971
+ reviews={reviews}
972
+ heading='Reseñas verificadas'
973
+ notice='Reseñas publicadas en Google y Doctoralia; cada una enlaza a su original.'
974
+ />
975
+ )
976
+ }
977
+
978
+ // Only the reviews linked to one page (a treatment, a professional's profile):
979
+ const { data: pageReviews } = await client.reviews.list({ pageId: page.id })
980
+ ```
981
+
982
+ - **Verifiable or not shown.** A review renders only with an `https://` link to
983
+ its original, a rating of 1 to 5 and an author; anything else is skipped.
984
+ The link opens in a new tab with `rel="noopener nofollow"` and a visually
985
+ hidden «(se abre en una pestaña nueva)» (`newWindowLabel`). Its text is
986
+ `linkLabel(sourceName)`, «Ver en Google» by default.
987
+ - **Notice.** `notice` is the tenant's short text on how its reviews are
988
+ checked. Spanish consumer law asks a business that shows reviews to say
989
+ whether and how it ensures they come from real customers; the exact wording
990
+ is the tenant's (pending legal review, REB-136). It goes below the grid, or
991
+ above it with `noticePosition='above'`.
992
+ - Stars are one `role="img"` labelled «5 de 5 estrellas». A star-only review
993
+ (`text: null`) renders without a quote. The date is the calendar day the
994
+ review was written, formatted in `locale` (default `es-ES`), never shifted
995
+ by the visitor's time zone.
996
+ - `null`, `undefined` or an empty list render nothing — no heading, no notice.
997
+ - `heading` wraps everything in a `<section aria-labelledby={headingId}>`
998
+ (default id `reviews-heading`, level `headingLevel`, default 2).
999
+ - Styling hooks: `className`, `cardClassName` (merge with `cn`);
1000
+ `headingClassName`, `gridClassName` and `noticeClassName` follow the REB-997
1001
+ slot rule and REPLACE their defaults (`text-xl font-semibold`,
1002
+ `sm:grid-cols-2 lg:grid-cols-3`, `text-sm text-muted-foreground`).
1003
+
930
1004
  ## Trust badges
931
1005
 
932
1006
  `TrustBadges` renders the tenant's trust badges — partners, insurers, funding,