@reblu/site-blocks 0.12.1 → 0.14.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 +54 -0
- package/README.md +168 -8
- package/dist/index.cjs +747 -278
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +213 -8
- package/dist/index.d.ts +213 -8
- package/dist/index.js +736 -277
- package/dist/index.js.map +1 -1
- package/dist/seo.cjs +13034 -12
- package/dist/seo.cjs.map +1 -1
- package/dist/seo.d.cts +22 -1
- package/dist/seo.d.ts +22 -1
- package/dist/seo.js +13032 -5
- package/dist/seo.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
import { FaqItem } from './seo.cjs';
|
|
3
|
-
export { FaqPageJsonLd, buildFaqPageJsonLd, collectFaqItems } from './seo.cjs';
|
|
3
|
+
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { ReactNode, ComponentType, FormEvent } from 'react';
|
|
6
6
|
|
|
7
7
|
declare function readingTime(content: string | null | undefined): number | null;
|
|
8
8
|
|
|
@@ -240,6 +240,50 @@ interface SafeHtmlProps {
|
|
|
240
240
|
}
|
|
241
241
|
declare function SafeHtml({ html, className, headingOffset }: SafeHtmlProps): react_jsx_runtime.JSX.Element | null;
|
|
242
242
|
|
|
243
|
+
/** A heading level a caller can configure — `h1`…`h6`. */
|
|
244
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* `CourseDescription` — the drop-in for `AcademyCourseDetail.description`
|
|
248
|
+
* (`client.academy.bySlug()`), REB-879. The description is rich-text Markdown
|
|
249
|
+
* written in nexus with the shared editor: headings, GFM tables, images.
|
|
250
|
+
*
|
|
251
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
252
|
+
*
|
|
253
|
+
* Semantics:
|
|
254
|
+
* - The Markdown goes through the same pipeline as {@link MarkdownRenderer}
|
|
255
|
+
* (`marked` → hast-util-sanitize → token-driven component map). It is never
|
|
256
|
+
* rendered as raw HTML: `<script>`, event handlers, `javascript:` links and
|
|
257
|
+
* non-allowlisted iframes are dropped.
|
|
258
|
+
* - `null`, `undefined`, blank text, or content the sanitiser empties render
|
|
259
|
+
* NOTHING — not even the heading. No default copy is ever invented.
|
|
260
|
+
* - `heading` is the SITE's own section title (its language, its words). When
|
|
261
|
+
* given, the block is a `<section>` labelled by it, and the description's own
|
|
262
|
+
* headings are demoted under it (`##` → one level below `headingLevel`).
|
|
263
|
+
*/
|
|
264
|
+
interface CourseDescriptionProps {
|
|
265
|
+
/** `AcademyCourseDetail.description` as served — may be `null` / `undefined`. */
|
|
266
|
+
description: string | null | undefined;
|
|
267
|
+
/** Optional section heading, e.g. «Sobre el curso». Omit to render the description alone. */
|
|
268
|
+
heading?: ReactNode;
|
|
269
|
+
/** Level of `heading`. Defaults to `2`. */
|
|
270
|
+
headingLevel?: HeadingLevel;
|
|
271
|
+
/** `id` of the heading element (the section's `aria-labelledby`). */
|
|
272
|
+
headingId?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Levels added to the description's own headings. Defaults to `headingLevel - 1`
|
|
275
|
+
* with a `heading` (so its `##` sits one level below it) and `0` without one.
|
|
276
|
+
*/
|
|
277
|
+
headingOffset?: number;
|
|
278
|
+
/** Classes for the outer element. */
|
|
279
|
+
className?: string;
|
|
280
|
+
/** Classes for the heading. */
|
|
281
|
+
headingClassName?: string;
|
|
282
|
+
/** Classes for the rendered Markdown body. */
|
|
283
|
+
contentClassName?: string;
|
|
284
|
+
}
|
|
285
|
+
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
286
|
+
|
|
243
287
|
/**
|
|
244
288
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
245
289
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -391,9 +435,6 @@ interface ProductTrustItemsProps {
|
|
|
391
435
|
}
|
|
392
436
|
declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
|
|
393
437
|
|
|
394
|
-
/** A heading level a caller can configure — `h1`…`h6`. */
|
|
395
|
-
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
396
|
-
|
|
397
438
|
/**
|
|
398
439
|
* REB-850 — accessible FAQ list on native `<details>`/`<summary>`.
|
|
399
440
|
*
|
|
@@ -642,12 +683,18 @@ interface CartLineListProps {
|
|
|
642
683
|
* `ReactNode` for custom content, or omit/`false` to render nothing.
|
|
643
684
|
*/
|
|
644
685
|
notice?: boolean | React.ReactNode;
|
|
686
|
+
/**
|
|
687
|
+
* REB-981 — a message rendered under a line (e.g. its cart-validation
|
|
688
|
+
* error from `useCartValidation().getLineError(...)?.message`). Return
|
|
689
|
+
* `null`/`undefined` for lines without one.
|
|
690
|
+
*/
|
|
691
|
+
lineMessage?: (item: CartLineItemView) => React.ReactNode;
|
|
645
692
|
labels?: Partial<CartLineListLabels>;
|
|
646
693
|
currencyCode?: string;
|
|
647
694
|
locale?: string;
|
|
648
695
|
className?: string;
|
|
649
696
|
}
|
|
650
|
-
declare function CartLineList({ items, onQuantityChange, onRemove, liveMessage, notice, labels, currencyCode, locale, className, }: CartLineListProps): react_jsx_runtime.JSX.Element;
|
|
697
|
+
declare function CartLineList({ items, onQuantityChange, onRemove, liveMessage, notice, lineMessage, labels, currencyCode, locale, className, }: CartLineListProps): react_jsx_runtime.JSX.Element;
|
|
651
698
|
|
|
652
699
|
/**
|
|
653
700
|
* `CartSummary` — presentational price breakdown (REB-829): subtotal,
|
|
@@ -699,6 +746,42 @@ interface CartSummaryProps {
|
|
|
699
746
|
}
|
|
700
747
|
declare function CartSummary({ subtotal, discount, discountCode, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
701
748
|
|
|
749
|
+
/**
|
|
750
|
+
* `CartAdjustmentsNotice` (REB-981) — tells the visitor what cart validation
|
|
751
|
+
* changed: lines removed because they can no longer be bought, quantities
|
|
752
|
+
* clamped to the stock left, and prices that changed since the line was
|
|
753
|
+
* added. Presentational only: feed it `@reblu/site-next/cart`'s
|
|
754
|
+
* `useCartValidation()` result (`removed`, `quantityChanges`,
|
|
755
|
+
* `priceChanges`) — every item shape is a structural subset of those.
|
|
756
|
+
* Renders nothing when there is nothing to report.
|
|
757
|
+
*/
|
|
758
|
+
interface CartAdjustmentLine {
|
|
759
|
+
name: string;
|
|
760
|
+
variantName?: string;
|
|
761
|
+
}
|
|
762
|
+
interface CartAdjustmentsNoticeLabels {
|
|
763
|
+
/** `names` already include the variant, e.g. `Gel (200 ml)`. */
|
|
764
|
+
removed: (names: string[]) => string;
|
|
765
|
+
quantityChanged: (name: string, quantity: number) => string;
|
|
766
|
+
priceChanged: (name: string, from: string, to: string) => string;
|
|
767
|
+
}
|
|
768
|
+
interface CartAdjustmentsNoticeProps {
|
|
769
|
+
removed?: CartAdjustmentLine[];
|
|
770
|
+
quantityChanges?: Array<CartAdjustmentLine & {
|
|
771
|
+
to: number;
|
|
772
|
+
}>;
|
|
773
|
+
/** `from`/`to` in integer cents. */
|
|
774
|
+
priceChanges?: Array<CartAdjustmentLine & {
|
|
775
|
+
from: number;
|
|
776
|
+
to: number;
|
|
777
|
+
}>;
|
|
778
|
+
labels?: Partial<CartAdjustmentsNoticeLabels>;
|
|
779
|
+
currencyCode?: string;
|
|
780
|
+
locale?: string;
|
|
781
|
+
className?: string;
|
|
782
|
+
}
|
|
783
|
+
declare function CartAdjustmentsNotice({ removed, quantityChanges, priceChanges, labels, currencyCode, locale, className, }: CartAdjustmentsNoticeProps): react_jsx_runtime.JSX.Element | null;
|
|
784
|
+
|
|
702
785
|
/**
|
|
703
786
|
* `AddedToCartToast` — add-to-cart feedback toast CONTENT (REB-837). Pure
|
|
704
787
|
* presentational, no hooks.
|
|
@@ -922,6 +1005,10 @@ interface OrderConfirmationLabels {
|
|
|
922
1005
|
errorDescription: string;
|
|
923
1006
|
/** REB-837 review fix — label for the neutral order-number-only reference shown on refunded/pending_timeout. */
|
|
924
1007
|
orderReferenceLabel: string;
|
|
1008
|
+
/** REB-73 — the invoice link text; `{number}` is replaced by the invoice number. */
|
|
1009
|
+
invoiceLinkLabel: string;
|
|
1010
|
+
/** REB-73 — the line under the invoice link. */
|
|
1011
|
+
invoiceSignInHint: string;
|
|
925
1012
|
}
|
|
926
1013
|
interface OrderConfirmationProps {
|
|
927
1014
|
status: OrderConfirmationStatus;
|
|
@@ -939,4 +1026,122 @@ interface OrderConfirmationProps {
|
|
|
939
1026
|
}
|
|
940
1027
|
declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
941
1028
|
|
|
942
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* `FullInvoiceFields` — the shop checkout's full-invoice request, drop-in
|
|
1031
|
+
* (REB-73). Fully controlled (`value`/`onChange`), no hooks, no fetch: the
|
|
1032
|
+
* SITE owns the state and sends `toCheckoutInvoiceFields(value, overCap)`
|
|
1033
|
+
* with its checkout body.
|
|
1034
|
+
*
|
|
1035
|
+
* The rule it presents (owner decision 15-Oct-2026): «Si quieren factura
|
|
1036
|
+
* completa, si o si deben aportar el NIF, si no lo aportan se emite factura
|
|
1037
|
+
* simplificada». The identifier is a Spanish NIF/NIE/CIF or, for a foreign
|
|
1038
|
+
* buyer, an EU VAT id, a passport or an ID document of their country — with
|
|
1039
|
+
* the country that issued it. Over the shop's simplified-invoice cap
|
|
1040
|
+
* (`ShopConfig.simplifiedInvoiceCapCents`, see `isOverSimplifiedInvoiceCap`)
|
|
1041
|
+
* a full invoice is the only legal one: pass `overCap` and the fields become
|
|
1042
|
+
* required, without a toggle. The server validates the identifier and
|
|
1043
|
+
* refuses with `BILLING_DATA_REQUIRED` what this form cannot prevent.
|
|
1044
|
+
*
|
|
1045
|
+
* A shop that issues no invoices (`ShopConfig.simplifiedInvoiceCapCents` is
|
|
1046
|
+
* `null`, see `shopIssuesInvoices`) offers no opt-in: pass
|
|
1047
|
+
* `issuesInvoices={false}` and the block renders nothing — the server would
|
|
1048
|
+
* refuse `wantsFullInvoice: true` with `FULL_INVOICE_UNAVAILABLE`.
|
|
1049
|
+
*/
|
|
1050
|
+
type FullInvoiceIdType = NonNullable<ShopBillingInput['billingIdType']>;
|
|
1051
|
+
interface FullInvoiceValue {
|
|
1052
|
+
wantsFullInvoice: boolean;
|
|
1053
|
+
billingIdType: FullInvoiceIdType;
|
|
1054
|
+
/** ISO 3166-1 alpha-2 country that issued a foreign document. */
|
|
1055
|
+
billingIdCountry: string;
|
|
1056
|
+
billingNif: string;
|
|
1057
|
+
billingName: string;
|
|
1058
|
+
street: string;
|
|
1059
|
+
postalCode: string;
|
|
1060
|
+
city: string;
|
|
1061
|
+
/** ISO 3166-1 alpha-2 country of the billing address. */
|
|
1062
|
+
country: string;
|
|
1063
|
+
}
|
|
1064
|
+
declare const EMPTY_FULL_INVOICE_VALUE: FullInvoiceValue;
|
|
1065
|
+
type FullInvoiceErrors = Partial<Record<'billingIdType' | 'billingIdCountry' | 'billingNif' | 'billingName' | 'address', string>>;
|
|
1066
|
+
interface FullInvoiceFieldsLabels {
|
|
1067
|
+
toggle: string;
|
|
1068
|
+
underCapNotice: string;
|
|
1069
|
+
overCapNotice: string;
|
|
1070
|
+
idType: string;
|
|
1071
|
+
idCountry: string;
|
|
1072
|
+
chooseCountry: string;
|
|
1073
|
+
spanishNif: string;
|
|
1074
|
+
documentNumber: string;
|
|
1075
|
+
name: string;
|
|
1076
|
+
street: string;
|
|
1077
|
+
postalCode: string;
|
|
1078
|
+
city: string;
|
|
1079
|
+
country: string;
|
|
1080
|
+
idTypeOptions: Record<FullInvoiceIdType, string>;
|
|
1081
|
+
}
|
|
1082
|
+
/** ISO 3166-1 alpha-2 countries offered by default: Spain, the EU and frequent others. */
|
|
1083
|
+
declare const DEFAULT_INVOICE_COUNTRIES: ReadonlyArray<{
|
|
1084
|
+
code: string;
|
|
1085
|
+
name: string;
|
|
1086
|
+
}>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Whether the shop issues invoices at all, read from the field the contract
|
|
1089
|
+
* defines for it: `ShopConfig.simplifiedInvoiceCapCents` is the effective cap
|
|
1090
|
+
* while invoicing is on and `null` otherwise (absent on an older base-api,
|
|
1091
|
+
* which accepts no opt-in either).
|
|
1092
|
+
*/
|
|
1093
|
+
declare function shopIssuesInvoices(config: {
|
|
1094
|
+
simplifiedInvoiceCapCents?: number | null;
|
|
1095
|
+
}): boolean;
|
|
1096
|
+
/** Whether a cart total (cents) is over the shop's simplified-invoice cap; `null` cap = no gate. */
|
|
1097
|
+
declare function isOverSimplifiedInvoiceCap(totalCents: number, capCents: number | null): boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* The checkout body fields for the request: `wantsFullInvoice` and the
|
|
1100
|
+
* `billing` block (identifier, its type and country, name and address). Empty
|
|
1101
|
+
* when the buyer asks for no full invoice within the cap, and always empty
|
|
1102
|
+
* when the shop issues no invoices (`issuesInvoices` false).
|
|
1103
|
+
*/
|
|
1104
|
+
declare function toCheckoutInvoiceFields(value: FullInvoiceValue, overCap: boolean, issuesInvoices?: boolean): Pick<ShopCheckoutInput, 'wantsFullInvoice' | 'billing'>;
|
|
1105
|
+
interface FullInvoiceFieldsProps {
|
|
1106
|
+
value: FullInvoiceValue;
|
|
1107
|
+
onChange: (next: FullInvoiceValue) => void;
|
|
1108
|
+
/** The cart total is over `ShopConfig.simplifiedInvoiceCapCents`. */
|
|
1109
|
+
overCap: boolean;
|
|
1110
|
+
/**
|
|
1111
|
+
* `false` when the shop issues no invoices (`shopIssuesInvoices(config)`):
|
|
1112
|
+
* the block renders nothing. Defaults to `true`.
|
|
1113
|
+
*/
|
|
1114
|
+
issuesInvoices?: boolean;
|
|
1115
|
+
errors?: FullInvoiceErrors;
|
|
1116
|
+
countries?: ReadonlyArray<{
|
|
1117
|
+
code: string;
|
|
1118
|
+
name: string;
|
|
1119
|
+
}>;
|
|
1120
|
+
labels?: Partial<FullInvoiceFieldsLabels>;
|
|
1121
|
+
className?: string;
|
|
1122
|
+
}
|
|
1123
|
+
declare function FullInvoiceFields({ value, onChange, overCap, issuesInvoices, errors, countries, labels, className, }: FullInvoiceFieldsProps): react_jsx_runtime.JSX.Element | null;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* `OrderInvoiceLink` — the sale invoice of an order, drop-in (REB-73). Pure
|
|
1127
|
+
* data in, RSC-safe (no hooks). Pass `order.invoice` from the order lookup
|
|
1128
|
+
* (`client.shop.order(sessionId)` / `useShopOrderStatus`): once the invoice
|
|
1129
|
+
* is issued it carries `{ number, url }`, where `url` is the tenant's
|
|
1130
|
+
* AUTHENTICATED portal route — the buyer signs in to open it, so the link
|
|
1131
|
+
* never expires and is safe to show. Renders nothing while there is none.
|
|
1132
|
+
* `OrderConfirmation` already renders it for a confirmed order.
|
|
1133
|
+
*/
|
|
1134
|
+
interface OrderInvoiceLinkLabels {
|
|
1135
|
+
/** The link text; `{number}` is replaced by the invoice number. */
|
|
1136
|
+
linkLabel: string;
|
|
1137
|
+
/** The line under the link. */
|
|
1138
|
+
signInHint: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface OrderInvoiceLinkProps {
|
|
1141
|
+
invoice: ShopOrderInvoice | null | undefined;
|
|
1142
|
+
labels?: Partial<OrderInvoiceLinkLabels>;
|
|
1143
|
+
className?: string;
|
|
1144
|
+
}
|
|
1145
|
+
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1146
|
+
|
|
1147
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
import { FaqItem } from './seo.js';
|
|
3
|
-
export { FaqPageJsonLd, buildFaqPageJsonLd, collectFaqItems } from './seo.js';
|
|
3
|
+
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { ReactNode, ComponentType, FormEvent } from 'react';
|
|
6
6
|
|
|
7
7
|
declare function readingTime(content: string | null | undefined): number | null;
|
|
8
8
|
|
|
@@ -240,6 +240,50 @@ interface SafeHtmlProps {
|
|
|
240
240
|
}
|
|
241
241
|
declare function SafeHtml({ html, className, headingOffset }: SafeHtmlProps): react_jsx_runtime.JSX.Element | null;
|
|
242
242
|
|
|
243
|
+
/** A heading level a caller can configure — `h1`…`h6`. */
|
|
244
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* `CourseDescription` — the drop-in for `AcademyCourseDetail.description`
|
|
248
|
+
* (`client.academy.bySlug()`), REB-879. The description is rich-text Markdown
|
|
249
|
+
* written in nexus with the shared editor: headings, GFM tables, images.
|
|
250
|
+
*
|
|
251
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
252
|
+
*
|
|
253
|
+
* Semantics:
|
|
254
|
+
* - The Markdown goes through the same pipeline as {@link MarkdownRenderer}
|
|
255
|
+
* (`marked` → hast-util-sanitize → token-driven component map). It is never
|
|
256
|
+
* rendered as raw HTML: `<script>`, event handlers, `javascript:` links and
|
|
257
|
+
* non-allowlisted iframes are dropped.
|
|
258
|
+
* - `null`, `undefined`, blank text, or content the sanitiser empties render
|
|
259
|
+
* NOTHING — not even the heading. No default copy is ever invented.
|
|
260
|
+
* - `heading` is the SITE's own section title (its language, its words). When
|
|
261
|
+
* given, the block is a `<section>` labelled by it, and the description's own
|
|
262
|
+
* headings are demoted under it (`##` → one level below `headingLevel`).
|
|
263
|
+
*/
|
|
264
|
+
interface CourseDescriptionProps {
|
|
265
|
+
/** `AcademyCourseDetail.description` as served — may be `null` / `undefined`. */
|
|
266
|
+
description: string | null | undefined;
|
|
267
|
+
/** Optional section heading, e.g. «Sobre el curso». Omit to render the description alone. */
|
|
268
|
+
heading?: ReactNode;
|
|
269
|
+
/** Level of `heading`. Defaults to `2`. */
|
|
270
|
+
headingLevel?: HeadingLevel;
|
|
271
|
+
/** `id` of the heading element (the section's `aria-labelledby`). */
|
|
272
|
+
headingId?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Levels added to the description's own headings. Defaults to `headingLevel - 1`
|
|
275
|
+
* with a `heading` (so its `##` sits one level below it) and `0` without one.
|
|
276
|
+
*/
|
|
277
|
+
headingOffset?: number;
|
|
278
|
+
/** Classes for the outer element. */
|
|
279
|
+
className?: string;
|
|
280
|
+
/** Classes for the heading. */
|
|
281
|
+
headingClassName?: string;
|
|
282
|
+
/** Classes for the rendered Markdown body. */
|
|
283
|
+
contentClassName?: string;
|
|
284
|
+
}
|
|
285
|
+
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
286
|
+
|
|
243
287
|
/**
|
|
244
288
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
245
289
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -391,9 +435,6 @@ interface ProductTrustItemsProps {
|
|
|
391
435
|
}
|
|
392
436
|
declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
|
|
393
437
|
|
|
394
|
-
/** A heading level a caller can configure — `h1`…`h6`. */
|
|
395
|
-
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
396
|
-
|
|
397
438
|
/**
|
|
398
439
|
* REB-850 — accessible FAQ list on native `<details>`/`<summary>`.
|
|
399
440
|
*
|
|
@@ -642,12 +683,18 @@ interface CartLineListProps {
|
|
|
642
683
|
* `ReactNode` for custom content, or omit/`false` to render nothing.
|
|
643
684
|
*/
|
|
644
685
|
notice?: boolean | React.ReactNode;
|
|
686
|
+
/**
|
|
687
|
+
* REB-981 — a message rendered under a line (e.g. its cart-validation
|
|
688
|
+
* error from `useCartValidation().getLineError(...)?.message`). Return
|
|
689
|
+
* `null`/`undefined` for lines without one.
|
|
690
|
+
*/
|
|
691
|
+
lineMessage?: (item: CartLineItemView) => React.ReactNode;
|
|
645
692
|
labels?: Partial<CartLineListLabels>;
|
|
646
693
|
currencyCode?: string;
|
|
647
694
|
locale?: string;
|
|
648
695
|
className?: string;
|
|
649
696
|
}
|
|
650
|
-
declare function CartLineList({ items, onQuantityChange, onRemove, liveMessage, notice, labels, currencyCode, locale, className, }: CartLineListProps): react_jsx_runtime.JSX.Element;
|
|
697
|
+
declare function CartLineList({ items, onQuantityChange, onRemove, liveMessage, notice, lineMessage, labels, currencyCode, locale, className, }: CartLineListProps): react_jsx_runtime.JSX.Element;
|
|
651
698
|
|
|
652
699
|
/**
|
|
653
700
|
* `CartSummary` — presentational price breakdown (REB-829): subtotal,
|
|
@@ -699,6 +746,42 @@ interface CartSummaryProps {
|
|
|
699
746
|
}
|
|
700
747
|
declare function CartSummary({ subtotal, discount, discountCode, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
701
748
|
|
|
749
|
+
/**
|
|
750
|
+
* `CartAdjustmentsNotice` (REB-981) — tells the visitor what cart validation
|
|
751
|
+
* changed: lines removed because they can no longer be bought, quantities
|
|
752
|
+
* clamped to the stock left, and prices that changed since the line was
|
|
753
|
+
* added. Presentational only: feed it `@reblu/site-next/cart`'s
|
|
754
|
+
* `useCartValidation()` result (`removed`, `quantityChanges`,
|
|
755
|
+
* `priceChanges`) — every item shape is a structural subset of those.
|
|
756
|
+
* Renders nothing when there is nothing to report.
|
|
757
|
+
*/
|
|
758
|
+
interface CartAdjustmentLine {
|
|
759
|
+
name: string;
|
|
760
|
+
variantName?: string;
|
|
761
|
+
}
|
|
762
|
+
interface CartAdjustmentsNoticeLabels {
|
|
763
|
+
/** `names` already include the variant, e.g. `Gel (200 ml)`. */
|
|
764
|
+
removed: (names: string[]) => string;
|
|
765
|
+
quantityChanged: (name: string, quantity: number) => string;
|
|
766
|
+
priceChanged: (name: string, from: string, to: string) => string;
|
|
767
|
+
}
|
|
768
|
+
interface CartAdjustmentsNoticeProps {
|
|
769
|
+
removed?: CartAdjustmentLine[];
|
|
770
|
+
quantityChanges?: Array<CartAdjustmentLine & {
|
|
771
|
+
to: number;
|
|
772
|
+
}>;
|
|
773
|
+
/** `from`/`to` in integer cents. */
|
|
774
|
+
priceChanges?: Array<CartAdjustmentLine & {
|
|
775
|
+
from: number;
|
|
776
|
+
to: number;
|
|
777
|
+
}>;
|
|
778
|
+
labels?: Partial<CartAdjustmentsNoticeLabels>;
|
|
779
|
+
currencyCode?: string;
|
|
780
|
+
locale?: string;
|
|
781
|
+
className?: string;
|
|
782
|
+
}
|
|
783
|
+
declare function CartAdjustmentsNotice({ removed, quantityChanges, priceChanges, labels, currencyCode, locale, className, }: CartAdjustmentsNoticeProps): react_jsx_runtime.JSX.Element | null;
|
|
784
|
+
|
|
702
785
|
/**
|
|
703
786
|
* `AddedToCartToast` — add-to-cart feedback toast CONTENT (REB-837). Pure
|
|
704
787
|
* presentational, no hooks.
|
|
@@ -922,6 +1005,10 @@ interface OrderConfirmationLabels {
|
|
|
922
1005
|
errorDescription: string;
|
|
923
1006
|
/** REB-837 review fix — label for the neutral order-number-only reference shown on refunded/pending_timeout. */
|
|
924
1007
|
orderReferenceLabel: string;
|
|
1008
|
+
/** REB-73 — the invoice link text; `{number}` is replaced by the invoice number. */
|
|
1009
|
+
invoiceLinkLabel: string;
|
|
1010
|
+
/** REB-73 — the line under the invoice link. */
|
|
1011
|
+
invoiceSignInHint: string;
|
|
925
1012
|
}
|
|
926
1013
|
interface OrderConfirmationProps {
|
|
927
1014
|
status: OrderConfirmationStatus;
|
|
@@ -939,4 +1026,122 @@ interface OrderConfirmationProps {
|
|
|
939
1026
|
}
|
|
940
1027
|
declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
941
1028
|
|
|
942
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* `FullInvoiceFields` — the shop checkout's full-invoice request, drop-in
|
|
1031
|
+
* (REB-73). Fully controlled (`value`/`onChange`), no hooks, no fetch: the
|
|
1032
|
+
* SITE owns the state and sends `toCheckoutInvoiceFields(value, overCap)`
|
|
1033
|
+
* with its checkout body.
|
|
1034
|
+
*
|
|
1035
|
+
* The rule it presents (owner decision 15-Oct-2026): «Si quieren factura
|
|
1036
|
+
* completa, si o si deben aportar el NIF, si no lo aportan se emite factura
|
|
1037
|
+
* simplificada». The identifier is a Spanish NIF/NIE/CIF or, for a foreign
|
|
1038
|
+
* buyer, an EU VAT id, a passport or an ID document of their country — with
|
|
1039
|
+
* the country that issued it. Over the shop's simplified-invoice cap
|
|
1040
|
+
* (`ShopConfig.simplifiedInvoiceCapCents`, see `isOverSimplifiedInvoiceCap`)
|
|
1041
|
+
* a full invoice is the only legal one: pass `overCap` and the fields become
|
|
1042
|
+
* required, without a toggle. The server validates the identifier and
|
|
1043
|
+
* refuses with `BILLING_DATA_REQUIRED` what this form cannot prevent.
|
|
1044
|
+
*
|
|
1045
|
+
* A shop that issues no invoices (`ShopConfig.simplifiedInvoiceCapCents` is
|
|
1046
|
+
* `null`, see `shopIssuesInvoices`) offers no opt-in: pass
|
|
1047
|
+
* `issuesInvoices={false}` and the block renders nothing — the server would
|
|
1048
|
+
* refuse `wantsFullInvoice: true` with `FULL_INVOICE_UNAVAILABLE`.
|
|
1049
|
+
*/
|
|
1050
|
+
type FullInvoiceIdType = NonNullable<ShopBillingInput['billingIdType']>;
|
|
1051
|
+
interface FullInvoiceValue {
|
|
1052
|
+
wantsFullInvoice: boolean;
|
|
1053
|
+
billingIdType: FullInvoiceIdType;
|
|
1054
|
+
/** ISO 3166-1 alpha-2 country that issued a foreign document. */
|
|
1055
|
+
billingIdCountry: string;
|
|
1056
|
+
billingNif: string;
|
|
1057
|
+
billingName: string;
|
|
1058
|
+
street: string;
|
|
1059
|
+
postalCode: string;
|
|
1060
|
+
city: string;
|
|
1061
|
+
/** ISO 3166-1 alpha-2 country of the billing address. */
|
|
1062
|
+
country: string;
|
|
1063
|
+
}
|
|
1064
|
+
declare const EMPTY_FULL_INVOICE_VALUE: FullInvoiceValue;
|
|
1065
|
+
type FullInvoiceErrors = Partial<Record<'billingIdType' | 'billingIdCountry' | 'billingNif' | 'billingName' | 'address', string>>;
|
|
1066
|
+
interface FullInvoiceFieldsLabels {
|
|
1067
|
+
toggle: string;
|
|
1068
|
+
underCapNotice: string;
|
|
1069
|
+
overCapNotice: string;
|
|
1070
|
+
idType: string;
|
|
1071
|
+
idCountry: string;
|
|
1072
|
+
chooseCountry: string;
|
|
1073
|
+
spanishNif: string;
|
|
1074
|
+
documentNumber: string;
|
|
1075
|
+
name: string;
|
|
1076
|
+
street: string;
|
|
1077
|
+
postalCode: string;
|
|
1078
|
+
city: string;
|
|
1079
|
+
country: string;
|
|
1080
|
+
idTypeOptions: Record<FullInvoiceIdType, string>;
|
|
1081
|
+
}
|
|
1082
|
+
/** ISO 3166-1 alpha-2 countries offered by default: Spain, the EU and frequent others. */
|
|
1083
|
+
declare const DEFAULT_INVOICE_COUNTRIES: ReadonlyArray<{
|
|
1084
|
+
code: string;
|
|
1085
|
+
name: string;
|
|
1086
|
+
}>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Whether the shop issues invoices at all, read from the field the contract
|
|
1089
|
+
* defines for it: `ShopConfig.simplifiedInvoiceCapCents` is the effective cap
|
|
1090
|
+
* while invoicing is on and `null` otherwise (absent on an older base-api,
|
|
1091
|
+
* which accepts no opt-in either).
|
|
1092
|
+
*/
|
|
1093
|
+
declare function shopIssuesInvoices(config: {
|
|
1094
|
+
simplifiedInvoiceCapCents?: number | null;
|
|
1095
|
+
}): boolean;
|
|
1096
|
+
/** Whether a cart total (cents) is over the shop's simplified-invoice cap; `null` cap = no gate. */
|
|
1097
|
+
declare function isOverSimplifiedInvoiceCap(totalCents: number, capCents: number | null): boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* The checkout body fields for the request: `wantsFullInvoice` and the
|
|
1100
|
+
* `billing` block (identifier, its type and country, name and address). Empty
|
|
1101
|
+
* when the buyer asks for no full invoice within the cap, and always empty
|
|
1102
|
+
* when the shop issues no invoices (`issuesInvoices` false).
|
|
1103
|
+
*/
|
|
1104
|
+
declare function toCheckoutInvoiceFields(value: FullInvoiceValue, overCap: boolean, issuesInvoices?: boolean): Pick<ShopCheckoutInput, 'wantsFullInvoice' | 'billing'>;
|
|
1105
|
+
interface FullInvoiceFieldsProps {
|
|
1106
|
+
value: FullInvoiceValue;
|
|
1107
|
+
onChange: (next: FullInvoiceValue) => void;
|
|
1108
|
+
/** The cart total is over `ShopConfig.simplifiedInvoiceCapCents`. */
|
|
1109
|
+
overCap: boolean;
|
|
1110
|
+
/**
|
|
1111
|
+
* `false` when the shop issues no invoices (`shopIssuesInvoices(config)`):
|
|
1112
|
+
* the block renders nothing. Defaults to `true`.
|
|
1113
|
+
*/
|
|
1114
|
+
issuesInvoices?: boolean;
|
|
1115
|
+
errors?: FullInvoiceErrors;
|
|
1116
|
+
countries?: ReadonlyArray<{
|
|
1117
|
+
code: string;
|
|
1118
|
+
name: string;
|
|
1119
|
+
}>;
|
|
1120
|
+
labels?: Partial<FullInvoiceFieldsLabels>;
|
|
1121
|
+
className?: string;
|
|
1122
|
+
}
|
|
1123
|
+
declare function FullInvoiceFields({ value, onChange, overCap, issuesInvoices, errors, countries, labels, className, }: FullInvoiceFieldsProps): react_jsx_runtime.JSX.Element | null;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* `OrderInvoiceLink` — the sale invoice of an order, drop-in (REB-73). Pure
|
|
1127
|
+
* data in, RSC-safe (no hooks). Pass `order.invoice` from the order lookup
|
|
1128
|
+
* (`client.shop.order(sessionId)` / `useShopOrderStatus`): once the invoice
|
|
1129
|
+
* is issued it carries `{ number, url }`, where `url` is the tenant's
|
|
1130
|
+
* AUTHENTICATED portal route — the buyer signs in to open it, so the link
|
|
1131
|
+
* never expires and is safe to show. Renders nothing while there is none.
|
|
1132
|
+
* `OrderConfirmation` already renders it for a confirmed order.
|
|
1133
|
+
*/
|
|
1134
|
+
interface OrderInvoiceLinkLabels {
|
|
1135
|
+
/** The link text; `{number}` is replaced by the invoice number. */
|
|
1136
|
+
linkLabel: string;
|
|
1137
|
+
/** The line under the link. */
|
|
1138
|
+
signInHint: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface OrderInvoiceLinkProps {
|
|
1141
|
+
invoice: ShopOrderInvoice | null | undefined;
|
|
1142
|
+
labels?: Partial<OrderInvoiceLinkLabels>;
|
|
1143
|
+
className?: string;
|
|
1144
|
+
}
|
|
1145
|
+
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1146
|
+
|
|
1147
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|