@reblu/site-blocks 0.11.0 → 0.12.1
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 +20 -0
- package/README.md +35 -0
- package/dist/index.cjs +281 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -8
- package/dist/index.d.ts +42 -8
- package/dist/index.js +280 -249
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -285,6 +285,26 @@ interface ParentPageProps {
|
|
|
285
285
|
}
|
|
286
286
|
declare function ParentPage({ page, childPages, childPageHref, childPagesLabel, treatments, treatmentHref, treatmentsLabel, className, }: ParentPageProps): react_jsx_runtime.JSX.Element;
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* `PageCardGrid` — a linked grid of page cards (cover image, title, excerpt)
|
|
290
|
+
* over any `PageListItem[]`, in the order given. Token-driven, RSC-safe.
|
|
291
|
+
*
|
|
292
|
+
* REB-869: extracted from `ParentPage`'s child-pages grid (same markup) so a
|
|
293
|
+
* SITE can drop it in anywhere — typically a landing teaser over
|
|
294
|
+
* `client.pages.featured(category)`, which returns the category's featured
|
|
295
|
+
* pages in the tenant's order, or its first pages when none are featured.
|
|
296
|
+
* Renders nothing for an empty list.
|
|
297
|
+
*/
|
|
298
|
+
interface PageCardGridProps {
|
|
299
|
+
pages: PageListItem[];
|
|
300
|
+
/** Builds a card's href from its page. Defaults to `/{slug}`. */
|
|
301
|
+
pageHref?: (page: PageListItem) => string;
|
|
302
|
+
/** Optional `<h2>` above the grid. */
|
|
303
|
+
heading?: string;
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
declare function PageCardGrid(props: PageCardGridProps): react_jsx_runtime.JSX.Element;
|
|
307
|
+
|
|
288
308
|
/**
|
|
289
309
|
* @deprecated Renamed to `ParentPage` (REB-853) — the SDK is niche-agnostic.
|
|
290
310
|
* Removed in the next major, not before 2027-03-31.
|
|
@@ -732,13 +752,20 @@ declare function AddedToCartToast({ status, productName, quantity, imageUrl, car
|
|
|
732
752
|
/**
|
|
733
753
|
* `CheckoutLoginPrompt` — the "login prompt hook" the checkout flow needs
|
|
734
754
|
* (REB-829): a guest-checkout identification dialog offering "continue with
|
|
735
|
-
* this email"
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
755
|
+
* this email" or "continue as guest" outright. Fully controlled/presentational
|
|
756
|
+
* — it performs NO fetch itself; the consuming SITE owns `email` state and
|
|
757
|
+
* decides what `onSubmitEmail` does.
|
|
758
|
+
*
|
|
759
|
+
* Never reveal whether an account exists (REB-834). Do NOT wire
|
|
760
|
+
* `onSubmitEmail` to `client.shop.checkEmail` (deprecated, it always answers
|
|
761
|
+
* `{ exists: false }`) or build any UI on an `exists` answer. Treat both
|
|
762
|
+
* actions the same way for every email: `onSubmitEmail` carries the typed
|
|
763
|
+
* email into the checkout (or into the SITE's own login page), and
|
|
764
|
+
* `onContinueAsGuest` proceeds without it. If a guest's email belongs to an
|
|
765
|
+
* account, the server links the order to it after payment — the browser is
|
|
766
|
+
* never told before. `checking`/`error` remain for a SITE's own synchronous
|
|
767
|
+
* work (e.g. saving the email to its checkout state); leave them unset
|
|
768
|
+
* otherwise.
|
|
742
769
|
*/
|
|
743
770
|
interface CheckoutLoginPromptLabels {
|
|
744
771
|
title: string;
|
|
@@ -773,6 +800,13 @@ declare function CheckoutLoginPrompt({ open, email, onEmailChange, onClose, onSu
|
|
|
773
800
|
* dependency surface minimal); the consuming SITE owns validation and wires
|
|
774
801
|
* its own `onSubmit`.
|
|
775
802
|
*
|
|
803
|
+
* Account handling (REB-834): render the same form for every email. The
|
|
804
|
+
* `loginPrompt` slot is a static «Iniciar sesión o continuar como invitado»
|
|
805
|
+
* offer — never a branch on whether the typed email has an account (the
|
|
806
|
+
* deprecated `client.shop.checkEmail` always answers `{ exists: false }`). If
|
|
807
|
+
* a guest's email belongs to an account, the server links the order to it
|
|
808
|
+
* after payment.
|
|
809
|
+
*
|
|
776
810
|
* Scope note: shipping/billing address collection is intentionally OUT of
|
|
777
811
|
* this component — those field sets vary by tenant shop config (shipping
|
|
778
812
|
* enabled/disabled, invoicing requirements) far more than the guest-email +
|
|
@@ -905,4 +939,4 @@ interface OrderConfirmationProps {
|
|
|
905
939
|
}
|
|
906
940
|
declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
907
941
|
|
|
908
|
-
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, 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, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, 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, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
|
|
942
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, 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, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, 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, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
|
package/dist/index.d.ts
CHANGED
|
@@ -285,6 +285,26 @@ interface ParentPageProps {
|
|
|
285
285
|
}
|
|
286
286
|
declare function ParentPage({ page, childPages, childPageHref, childPagesLabel, treatments, treatmentHref, treatmentsLabel, className, }: ParentPageProps): react_jsx_runtime.JSX.Element;
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* `PageCardGrid` — a linked grid of page cards (cover image, title, excerpt)
|
|
290
|
+
* over any `PageListItem[]`, in the order given. Token-driven, RSC-safe.
|
|
291
|
+
*
|
|
292
|
+
* REB-869: extracted from `ParentPage`'s child-pages grid (same markup) so a
|
|
293
|
+
* SITE can drop it in anywhere — typically a landing teaser over
|
|
294
|
+
* `client.pages.featured(category)`, which returns the category's featured
|
|
295
|
+
* pages in the tenant's order, or its first pages when none are featured.
|
|
296
|
+
* Renders nothing for an empty list.
|
|
297
|
+
*/
|
|
298
|
+
interface PageCardGridProps {
|
|
299
|
+
pages: PageListItem[];
|
|
300
|
+
/** Builds a card's href from its page. Defaults to `/{slug}`. */
|
|
301
|
+
pageHref?: (page: PageListItem) => string;
|
|
302
|
+
/** Optional `<h2>` above the grid. */
|
|
303
|
+
heading?: string;
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
declare function PageCardGrid(props: PageCardGridProps): react_jsx_runtime.JSX.Element;
|
|
307
|
+
|
|
288
308
|
/**
|
|
289
309
|
* @deprecated Renamed to `ParentPage` (REB-853) — the SDK is niche-agnostic.
|
|
290
310
|
* Removed in the next major, not before 2027-03-31.
|
|
@@ -732,13 +752,20 @@ declare function AddedToCartToast({ status, productName, quantity, imageUrl, car
|
|
|
732
752
|
/**
|
|
733
753
|
* `CheckoutLoginPrompt` — the "login prompt hook" the checkout flow needs
|
|
734
754
|
* (REB-829): a guest-checkout identification dialog offering "continue with
|
|
735
|
-
* this email"
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
755
|
+
* this email" or "continue as guest" outright. Fully controlled/presentational
|
|
756
|
+
* — it performs NO fetch itself; the consuming SITE owns `email` state and
|
|
757
|
+
* decides what `onSubmitEmail` does.
|
|
758
|
+
*
|
|
759
|
+
* Never reveal whether an account exists (REB-834). Do NOT wire
|
|
760
|
+
* `onSubmitEmail` to `client.shop.checkEmail` (deprecated, it always answers
|
|
761
|
+
* `{ exists: false }`) or build any UI on an `exists` answer. Treat both
|
|
762
|
+
* actions the same way for every email: `onSubmitEmail` carries the typed
|
|
763
|
+
* email into the checkout (or into the SITE's own login page), and
|
|
764
|
+
* `onContinueAsGuest` proceeds without it. If a guest's email belongs to an
|
|
765
|
+
* account, the server links the order to it after payment — the browser is
|
|
766
|
+
* never told before. `checking`/`error` remain for a SITE's own synchronous
|
|
767
|
+
* work (e.g. saving the email to its checkout state); leave them unset
|
|
768
|
+
* otherwise.
|
|
742
769
|
*/
|
|
743
770
|
interface CheckoutLoginPromptLabels {
|
|
744
771
|
title: string;
|
|
@@ -773,6 +800,13 @@ declare function CheckoutLoginPrompt({ open, email, onEmailChange, onClose, onSu
|
|
|
773
800
|
* dependency surface minimal); the consuming SITE owns validation and wires
|
|
774
801
|
* its own `onSubmit`.
|
|
775
802
|
*
|
|
803
|
+
* Account handling (REB-834): render the same form for every email. The
|
|
804
|
+
* `loginPrompt` slot is a static «Iniciar sesión o continuar como invitado»
|
|
805
|
+
* offer — never a branch on whether the typed email has an account (the
|
|
806
|
+
* deprecated `client.shop.checkEmail` always answers `{ exists: false }`). If
|
|
807
|
+
* a guest's email belongs to an account, the server links the order to it
|
|
808
|
+
* after payment.
|
|
809
|
+
*
|
|
776
810
|
* Scope note: shipping/billing address collection is intentionally OUT of
|
|
777
811
|
* this component — those field sets vary by tenant shop config (shipping
|
|
778
812
|
* enabled/disabled, invoicing requirements) far more than the guest-email +
|
|
@@ -905,4 +939,4 @@ interface OrderConfirmationProps {
|
|
|
905
939
|
}
|
|
906
940
|
declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
907
941
|
|
|
908
|
-
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, 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, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, 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, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
|
|
942
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, 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, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, 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, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
|