@reblu/site-blocks 0.19.0 → 0.21.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 +29 -0
- package/README.md +126 -2
- package/dist/client.cjs +372 -45
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +78 -2
- package/dist/client.d.ts +78 -2
- package/dist/client.js +369 -44
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +440 -305
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -4
- package/dist/index.d.ts +68 -4
- package/dist/index.js +438 -305
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.cjs';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.cjs';
|
|
@@ -319,6 +319,49 @@ interface CourseDescriptionProps {
|
|
|
319
319
|
}
|
|
320
320
|
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
|
+
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
325
|
+
* `GET /api/site/academy/courses/{slug}/lessons/{lessonSlug}`.
|
|
326
|
+
*
|
|
327
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`, no player
|
|
328
|
+
* dependency. The video is the provider's hosted player in an `<iframe>`
|
|
329
|
+
* (`video.embedUrl`, already carrying its short-lived token), so the SDK pulls
|
|
330
|
+
* in no video library and a SITE needs no player code. Only an `https:` URL is
|
|
331
|
+
* ever embedded.
|
|
332
|
+
*
|
|
333
|
+
* The body (`content`, Markdown) goes through the same pipeline as
|
|
334
|
+
* `CourseDescription` / `MarkdownRenderer` (`marked` → hast-util-sanitize):
|
|
335
|
+
* never raw HTML, no scripts, no `javascript:` links. Its own headings sit one
|
|
336
|
+
* level below the lesson title.
|
|
337
|
+
*
|
|
338
|
+
* CSP note for the SITE: the player needs `frame-src https://player.mux.com`.
|
|
339
|
+
*/
|
|
340
|
+
interface LessonPreviewLabels {
|
|
341
|
+
/** Badge above the title. */
|
|
342
|
+
badge: string;
|
|
343
|
+
/** Prefix of the player's accessible name: «Vídeo: {title}». */
|
|
344
|
+
player: string;
|
|
345
|
+
/** Visually hidden name of the duration. */
|
|
346
|
+
duration: string;
|
|
347
|
+
}
|
|
348
|
+
declare const DEFAULT_LESSON_PREVIEW_LABELS: LessonPreviewLabels;
|
|
349
|
+
interface LessonPreviewProps {
|
|
350
|
+
/** The preview as served (`AcademyLessonPreview`). */
|
|
351
|
+
lesson: AcademyLessonPreview;
|
|
352
|
+
labels?: Partial<LessonPreviewLabels>;
|
|
353
|
+
/** Level of the lesson title. Default `2`; use `1` on a dedicated preview page. */
|
|
354
|
+
headingLevel?: HeadingLevel;
|
|
355
|
+
/** `id` of the title (the article's `aria-labelledby`). */
|
|
356
|
+
headingId?: string;
|
|
357
|
+
/** Replaces the title's default typography (see the className rule in the README). */
|
|
358
|
+
headingClassName?: string;
|
|
359
|
+
/** Replaces the body's default colour. */
|
|
360
|
+
contentClassName?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
}
|
|
363
|
+
declare function LessonPreview({ lesson, labels: labelOverrides, headingLevel, headingId, headingClassName, contentClassName, className, }: LessonPreviewProps): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
322
365
|
/**
|
|
323
366
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
324
367
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -854,6 +897,8 @@ interface CartSummaryLabels {
|
|
|
854
897
|
total: string;
|
|
855
898
|
/** REB-837 — default copy for `notice={true}`. */
|
|
856
899
|
cancelledNotice: string;
|
|
900
|
+
/** REB-1131 — the discount line when `autoDiscount` is set. */
|
|
901
|
+
staffDiscountApplied: string;
|
|
857
902
|
}
|
|
858
903
|
interface CartSummaryProps {
|
|
859
904
|
/** Integer cents. */
|
|
@@ -862,6 +907,14 @@ interface CartSummaryProps {
|
|
|
862
907
|
discount?: number;
|
|
863
908
|
/** The applied discount code, shown next to the discount amount. */
|
|
864
909
|
discountCode?: string;
|
|
910
|
+
/**
|
|
911
|
+
* REB-1131 — the automatic staff discount from the site API
|
|
912
|
+
* (`validateCart().autoDiscount`, or `autoDiscount` on apply-discount).
|
|
913
|
+
* When set, the discount line reads «Descuento de personal aplicado»
|
|
914
|
+
* (`labels.staffDiscountApplied`) and its amount is `discount` if given,
|
|
915
|
+
* else `autoDiscount.amount`. The code itself is not shown.
|
|
916
|
+
*/
|
|
917
|
+
autoDiscount?: Pick<ShopStaffAutoDiscount, 'amount'> | null;
|
|
865
918
|
/** Integer cents. Only rendered when `shippingEnabled` is true. */
|
|
866
919
|
shipping?: number | null;
|
|
867
920
|
/** Whether this tenant's shop even has shipping cost — hides the line entirely when false/omitted. */
|
|
@@ -881,7 +934,7 @@ interface CartSummaryProps {
|
|
|
881
934
|
locale?: string;
|
|
882
935
|
className?: string;
|
|
883
936
|
}
|
|
884
|
-
declare function CartSummary({ subtotal, discount, discountCode, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
937
|
+
declare function CartSummary({ subtotal, discount, discountCode, autoDiscount, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
885
938
|
|
|
886
939
|
/**
|
|
887
940
|
* `CartAdjustmentsNotice` (REB-981) — tells the visitor what cart validation
|
|
@@ -1057,6 +1110,8 @@ interface CheckoutFormLabels {
|
|
|
1057
1110
|
applyingDiscount: string;
|
|
1058
1111
|
removeDiscount: string;
|
|
1059
1112
|
discountAppliedSuffix: (formattedAmount: string) => string;
|
|
1113
|
+
/** REB-1131 — shown when `autoDiscount` is set. */
|
|
1114
|
+
staffDiscountApplied: string;
|
|
1060
1115
|
submit: string;
|
|
1061
1116
|
submitting: string;
|
|
1062
1117
|
}
|
|
@@ -1077,6 +1132,15 @@ interface CheckoutFormProps {
|
|
|
1077
1132
|
onApplyDiscount: () => void;
|
|
1078
1133
|
onRemoveDiscount: () => void;
|
|
1079
1134
|
appliedDiscount?: CheckoutAppliedDiscount | null;
|
|
1135
|
+
/**
|
|
1136
|
+
* REB-1131 — the automatic staff discount from the site API (`autoDiscount`
|
|
1137
|
+
* on validate-cart / apply-discount). When set, the discount section shows
|
|
1138
|
+
* «Descuento de personal aplicado» with its amount and no remove action
|
|
1139
|
+
* (it is not the buyer's to remove), and the code field stays available:
|
|
1140
|
+
* a typed code replaces it only when the server finds it larger. Takes
|
|
1141
|
+
* precedence over `appliedDiscount`.
|
|
1142
|
+
*/
|
|
1143
|
+
autoDiscount?: Pick<ShopStaffAutoDiscount, 'amount'> | null;
|
|
1080
1144
|
discountApplying?: boolean;
|
|
1081
1145
|
discountError?: string | null;
|
|
1082
1146
|
/**
|
|
@@ -1097,7 +1161,7 @@ interface CheckoutFormProps {
|
|
|
1097
1161
|
locale?: string;
|
|
1098
1162
|
className?: string;
|
|
1099
1163
|
}
|
|
1100
|
-
declare function CheckoutForm({ contact, onContactChange, contactErrors, phoneRegion, checkoutError, discountCode, onDiscountCodeChange, onApplyDiscount, onRemoveDiscount, appliedDiscount, discountApplying, discountError, loginPrompt, children, submitting, submitDisabled, onSubmit, labels, currencyCode, locale, className, }: CheckoutFormProps): react_jsx_runtime.JSX.Element;
|
|
1164
|
+
declare function CheckoutForm({ contact, onContactChange, contactErrors, phoneRegion, checkoutError, discountCode, onDiscountCodeChange, onApplyDiscount, onRemoveDiscount, appliedDiscount, autoDiscount, discountApplying, discountError, loginPrompt, children, submitting, submitDisabled, onSubmit, labels, currencyCode, locale, className, }: CheckoutFormProps): react_jsx_runtime.JSX.Element;
|
|
1101
1165
|
|
|
1102
1166
|
/**
|
|
1103
1167
|
* `OrderConfirmation` — presentational order-confirmation view (REB-829,
|
|
@@ -1281,4 +1345,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1281
1345
|
}
|
|
1282
1346
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1283
1347
|
|
|
1284
|
-
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_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
|
1348
|
+
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_LESSON_PREVIEW_LABELS, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.js';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.js';
|
|
@@ -319,6 +319,49 @@ interface CourseDescriptionProps {
|
|
|
319
319
|
}
|
|
320
320
|
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
|
+
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
325
|
+
* `GET /api/site/academy/courses/{slug}/lessons/{lessonSlug}`.
|
|
326
|
+
*
|
|
327
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`, no player
|
|
328
|
+
* dependency. The video is the provider's hosted player in an `<iframe>`
|
|
329
|
+
* (`video.embedUrl`, already carrying its short-lived token), so the SDK pulls
|
|
330
|
+
* in no video library and a SITE needs no player code. Only an `https:` URL is
|
|
331
|
+
* ever embedded.
|
|
332
|
+
*
|
|
333
|
+
* The body (`content`, Markdown) goes through the same pipeline as
|
|
334
|
+
* `CourseDescription` / `MarkdownRenderer` (`marked` → hast-util-sanitize):
|
|
335
|
+
* never raw HTML, no scripts, no `javascript:` links. Its own headings sit one
|
|
336
|
+
* level below the lesson title.
|
|
337
|
+
*
|
|
338
|
+
* CSP note for the SITE: the player needs `frame-src https://player.mux.com`.
|
|
339
|
+
*/
|
|
340
|
+
interface LessonPreviewLabels {
|
|
341
|
+
/** Badge above the title. */
|
|
342
|
+
badge: string;
|
|
343
|
+
/** Prefix of the player's accessible name: «Vídeo: {title}». */
|
|
344
|
+
player: string;
|
|
345
|
+
/** Visually hidden name of the duration. */
|
|
346
|
+
duration: string;
|
|
347
|
+
}
|
|
348
|
+
declare const DEFAULT_LESSON_PREVIEW_LABELS: LessonPreviewLabels;
|
|
349
|
+
interface LessonPreviewProps {
|
|
350
|
+
/** The preview as served (`AcademyLessonPreview`). */
|
|
351
|
+
lesson: AcademyLessonPreview;
|
|
352
|
+
labels?: Partial<LessonPreviewLabels>;
|
|
353
|
+
/** Level of the lesson title. Default `2`; use `1` on a dedicated preview page. */
|
|
354
|
+
headingLevel?: HeadingLevel;
|
|
355
|
+
/** `id` of the title (the article's `aria-labelledby`). */
|
|
356
|
+
headingId?: string;
|
|
357
|
+
/** Replaces the title's default typography (see the className rule in the README). */
|
|
358
|
+
headingClassName?: string;
|
|
359
|
+
/** Replaces the body's default colour. */
|
|
360
|
+
contentClassName?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
}
|
|
363
|
+
declare function LessonPreview({ lesson, labels: labelOverrides, headingLevel, headingId, headingClassName, contentClassName, className, }: LessonPreviewProps): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
322
365
|
/**
|
|
323
366
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
324
367
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -854,6 +897,8 @@ interface CartSummaryLabels {
|
|
|
854
897
|
total: string;
|
|
855
898
|
/** REB-837 — default copy for `notice={true}`. */
|
|
856
899
|
cancelledNotice: string;
|
|
900
|
+
/** REB-1131 — the discount line when `autoDiscount` is set. */
|
|
901
|
+
staffDiscountApplied: string;
|
|
857
902
|
}
|
|
858
903
|
interface CartSummaryProps {
|
|
859
904
|
/** Integer cents. */
|
|
@@ -862,6 +907,14 @@ interface CartSummaryProps {
|
|
|
862
907
|
discount?: number;
|
|
863
908
|
/** The applied discount code, shown next to the discount amount. */
|
|
864
909
|
discountCode?: string;
|
|
910
|
+
/**
|
|
911
|
+
* REB-1131 — the automatic staff discount from the site API
|
|
912
|
+
* (`validateCart().autoDiscount`, or `autoDiscount` on apply-discount).
|
|
913
|
+
* When set, the discount line reads «Descuento de personal aplicado»
|
|
914
|
+
* (`labels.staffDiscountApplied`) and its amount is `discount` if given,
|
|
915
|
+
* else `autoDiscount.amount`. The code itself is not shown.
|
|
916
|
+
*/
|
|
917
|
+
autoDiscount?: Pick<ShopStaffAutoDiscount, 'amount'> | null;
|
|
865
918
|
/** Integer cents. Only rendered when `shippingEnabled` is true. */
|
|
866
919
|
shipping?: number | null;
|
|
867
920
|
/** Whether this tenant's shop even has shipping cost — hides the line entirely when false/omitted. */
|
|
@@ -881,7 +934,7 @@ interface CartSummaryProps {
|
|
|
881
934
|
locale?: string;
|
|
882
935
|
className?: string;
|
|
883
936
|
}
|
|
884
|
-
declare function CartSummary({ subtotal, discount, discountCode, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
937
|
+
declare function CartSummary({ subtotal, discount, discountCode, autoDiscount, shipping, shippingEnabled, total, notice, labels, currencyCode, locale, className, }: CartSummaryProps): react_jsx_runtime.JSX.Element;
|
|
885
938
|
|
|
886
939
|
/**
|
|
887
940
|
* `CartAdjustmentsNotice` (REB-981) — tells the visitor what cart validation
|
|
@@ -1057,6 +1110,8 @@ interface CheckoutFormLabels {
|
|
|
1057
1110
|
applyingDiscount: string;
|
|
1058
1111
|
removeDiscount: string;
|
|
1059
1112
|
discountAppliedSuffix: (formattedAmount: string) => string;
|
|
1113
|
+
/** REB-1131 — shown when `autoDiscount` is set. */
|
|
1114
|
+
staffDiscountApplied: string;
|
|
1060
1115
|
submit: string;
|
|
1061
1116
|
submitting: string;
|
|
1062
1117
|
}
|
|
@@ -1077,6 +1132,15 @@ interface CheckoutFormProps {
|
|
|
1077
1132
|
onApplyDiscount: () => void;
|
|
1078
1133
|
onRemoveDiscount: () => void;
|
|
1079
1134
|
appliedDiscount?: CheckoutAppliedDiscount | null;
|
|
1135
|
+
/**
|
|
1136
|
+
* REB-1131 — the automatic staff discount from the site API (`autoDiscount`
|
|
1137
|
+
* on validate-cart / apply-discount). When set, the discount section shows
|
|
1138
|
+
* «Descuento de personal aplicado» with its amount and no remove action
|
|
1139
|
+
* (it is not the buyer's to remove), and the code field stays available:
|
|
1140
|
+
* a typed code replaces it only when the server finds it larger. Takes
|
|
1141
|
+
* precedence over `appliedDiscount`.
|
|
1142
|
+
*/
|
|
1143
|
+
autoDiscount?: Pick<ShopStaffAutoDiscount, 'amount'> | null;
|
|
1080
1144
|
discountApplying?: boolean;
|
|
1081
1145
|
discountError?: string | null;
|
|
1082
1146
|
/**
|
|
@@ -1097,7 +1161,7 @@ interface CheckoutFormProps {
|
|
|
1097
1161
|
locale?: string;
|
|
1098
1162
|
className?: string;
|
|
1099
1163
|
}
|
|
1100
|
-
declare function CheckoutForm({ contact, onContactChange, contactErrors, phoneRegion, checkoutError, discountCode, onDiscountCodeChange, onApplyDiscount, onRemoveDiscount, appliedDiscount, discountApplying, discountError, loginPrompt, children, submitting, submitDisabled, onSubmit, labels, currencyCode, locale, className, }: CheckoutFormProps): react_jsx_runtime.JSX.Element;
|
|
1164
|
+
declare function CheckoutForm({ contact, onContactChange, contactErrors, phoneRegion, checkoutError, discountCode, onDiscountCodeChange, onApplyDiscount, onRemoveDiscount, appliedDiscount, autoDiscount, discountApplying, discountError, loginPrompt, children, submitting, submitDisabled, onSubmit, labels, currencyCode, locale, className, }: CheckoutFormProps): react_jsx_runtime.JSX.Element;
|
|
1101
1165
|
|
|
1102
1166
|
/**
|
|
1103
1167
|
* `OrderConfirmation` — presentational order-confirmation view (REB-829,
|
|
@@ -1281,4 +1345,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1281
1345
|
}
|
|
1282
1346
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1283
1347
|
|
|
1284
|
-
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_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
|
1348
|
+
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_LESSON_PREVIEW_LABELS, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|