@reblu/site-blocks 0.32.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 +18 -0
- package/README.md +24 -1
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
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
|
+
|
|
3
21
|
## 0.32.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -334,7 +334,7 @@ for the wiring steps and a full example app).
|
|
|
334
334
|
| `CartSummary` | `.` | `subtotal`, `discount?`, `autoDiscount?`, `shipping?`, `shippingEnabled?`, `total`, `notice?` | Yes |
|
|
335
335
|
| `CheckoutLoginPrompt` | `.` | `open`, `email`, `onEmailChange`, `onClose`, `onSubmitEmail`, `onContinueAsGuest` | Yes (renders `null` when `open` is false) |
|
|
336
336
|
| `CheckoutForm` | `.` | `contact`, `onContactChange`, `discountCode`, `onDiscountCodeChange`, `onApplyDiscount`, `onRemoveDiscount`, `onSubmit`, `autoDiscount?` | Yes |
|
|
337
|
-
| `OrderConfirmation` | `.` | `status`, `order`, `cartHref?`, `onRecheck?`
|
|
337
|
+
| `OrderConfirmation` | `.` | `status`, `order`, `cartHref?`, `onRecheck?`, `showPurchaseTexts?` | Yes |
|
|
338
338
|
| `OrderInvoiceLink` | `.` | `invoice` (`order.invoice`), `labels?` | Yes (renders `null` without an invoice) |
|
|
339
339
|
| `FullInvoiceFields` | `.` | `value`, `onChange`, `overCap`, `errors?`, `countries?`, `labels?` | Yes (controlled, no hooks) |
|
|
340
340
|
|
|
@@ -604,6 +604,29 @@ shown instead of a raw placeholder. A SITE that passes its own
|
|
|
604
604
|
`labels.foundDescription` is unaffected: a text without `{email}` keeps the
|
|
605
605
|
confirmation-email line, exactly as before.
|
|
606
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
|
+
|
|
607
630
|
Every title/description is overridable via `labels` (see
|
|
608
631
|
`OrderConfirmationLabels`). See `@reblu/site-next`'s README
|
|
609
632
|
"`useShopOrderStatus` — the order-confirmation flow" for the full wiring
|
package/dist/index.cjs
CHANGED
|
@@ -16401,6 +16401,7 @@ function OrderConfirmation({
|
|
|
16401
16401
|
sessionId,
|
|
16402
16402
|
cartHref,
|
|
16403
16403
|
onRecheck,
|
|
16404
|
+
showPurchaseTexts = true,
|
|
16404
16405
|
labels,
|
|
16405
16406
|
currencyCode,
|
|
16406
16407
|
locale,
|
|
@@ -16458,6 +16459,23 @@ function OrderConfirmation({
|
|
|
16458
16459
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
16459
16460
|
] }) })
|
|
16460
16461
|
] }),
|
|
16462
|
+
showPurchaseTexts && order.purchaseTexts?.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mx-auto max-w-sm space-y-3 text-left", "data-slot": "order-confirmation-purchase-texts", children: order.purchaseTexts.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16463
|
+
"div",
|
|
16464
|
+
{
|
|
16465
|
+
className: "rounded-xl border border-border bg-card p-4",
|
|
16466
|
+
"data-slot": "order-confirmation-purchase-text",
|
|
16467
|
+
"data-kind": entry.kind,
|
|
16468
|
+
children: [
|
|
16469
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: entry.label }),
|
|
16470
|
+
entry.place ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("address", { className: "mb-2 text-sm not-italic", "data-slot": "order-confirmation-pickup-place", children: [
|
|
16471
|
+
entry.place.name ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "block font-medium", children: entry.place.name }) : null,
|
|
16472
|
+
entry.place.address.map((line) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "block", children: line }, line))
|
|
16473
|
+
] }) : null,
|
|
16474
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "whitespace-pre-line text-sm", children: entry.text })
|
|
16475
|
+
]
|
|
16476
|
+
},
|
|
16477
|
+
entry.kind
|
|
16478
|
+
)) }) : null,
|
|
16461
16479
|
t.foundDescription.includes("{email}") ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
16462
16480
|
t.confirmationEmailPrefix,
|
|
16463
16481
|
" ",
|