@behio/storefront-sdk 2.18.0 → 2.20.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/dist/{client-CBNbEn0x.d.mts → client-B_nmL9ab.d.mts} +22 -1
- package/dist/{client-CBNbEn0x.d.ts → client-B_nmL9ab.d.ts} +22 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/react.d.mts +60 -2
- package/dist/react.d.ts +60 -2
- package/dist/react.js +12 -0
- package/dist/react.mjs +11 -0
- package/package.json +1 -1
|
@@ -209,6 +209,13 @@ interface ShopInfo {
|
|
|
209
209
|
};
|
|
210
210
|
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
211
211
|
commerce?: ShopCommerce;
|
|
212
|
+
/**
|
|
213
|
+
* IANA time zone of the site (SDK 2.19.0), e.g. "Europe/Prague". Format dates
|
|
214
|
+
* with `Intl.DateTimeFormat(locale, {timeZone})` so the server render and the
|
|
215
|
+
* browser agree (no hydration mismatch) and show the merchant's day. Optional
|
|
216
|
+
* because cached payloads predating 2.19.0 may still be served.
|
|
217
|
+
*/
|
|
218
|
+
timezone?: string;
|
|
212
219
|
id: string;
|
|
213
220
|
name: string;
|
|
214
221
|
domain: string;
|
|
@@ -2195,7 +2202,20 @@ interface Page {
|
|
|
2195
2202
|
interface PageDetail {
|
|
2196
2203
|
slug: string;
|
|
2197
2204
|
title: string;
|
|
2198
|
-
|
|
2205
|
+
/**
|
|
2206
|
+
* Page body as ready to render, sanitized HTML. Always a string, empty when
|
|
2207
|
+
* the page has no body. Markdown pages are converted on the server and their
|
|
2208
|
+
* headings start at `<h2>` (the page renders its own `<h1>` from `title`).
|
|
2209
|
+
* Render it with `<RichText html={page.contentHtml} />` from
|
|
2210
|
+
* `@behio/storefront-sdk/react`.
|
|
2211
|
+
*/
|
|
2212
|
+
contentHtml: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* @deprecated Read `contentHtml`. The page body as a string: sanitized HTML,
|
|
2215
|
+
* or markdown for older pages written in markdown (convert it yourself).
|
|
2216
|
+
* Kept for storefronts built before SDK 2.20.0.
|
|
2217
|
+
*/
|
|
2218
|
+
content: string;
|
|
2199
2219
|
seoTitle?: string;
|
|
2200
2220
|
seoDescription?: string;
|
|
2201
2221
|
ogTitle?: string;
|
|
@@ -2204,6 +2224,7 @@ interface PageDetail {
|
|
|
2204
2224
|
/** Downloadable files attached to the page (e.g. legal form PDFs). */
|
|
2205
2225
|
attachments: PageAttachment[];
|
|
2206
2226
|
}
|
|
2227
|
+
/** A downloadable file attached to a page. Link to `url`. */
|
|
2207
2228
|
interface PageAttachment {
|
|
2208
2229
|
name: string;
|
|
2209
2230
|
description: string | null;
|
|
@@ -209,6 +209,13 @@ interface ShopInfo {
|
|
|
209
209
|
};
|
|
210
210
|
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
211
211
|
commerce?: ShopCommerce;
|
|
212
|
+
/**
|
|
213
|
+
* IANA time zone of the site (SDK 2.19.0), e.g. "Europe/Prague". Format dates
|
|
214
|
+
* with `Intl.DateTimeFormat(locale, {timeZone})` so the server render and the
|
|
215
|
+
* browser agree (no hydration mismatch) and show the merchant's day. Optional
|
|
216
|
+
* because cached payloads predating 2.19.0 may still be served.
|
|
217
|
+
*/
|
|
218
|
+
timezone?: string;
|
|
212
219
|
id: string;
|
|
213
220
|
name: string;
|
|
214
221
|
domain: string;
|
|
@@ -2195,7 +2202,20 @@ interface Page {
|
|
|
2195
2202
|
interface PageDetail {
|
|
2196
2203
|
slug: string;
|
|
2197
2204
|
title: string;
|
|
2198
|
-
|
|
2205
|
+
/**
|
|
2206
|
+
* Page body as ready to render, sanitized HTML. Always a string, empty when
|
|
2207
|
+
* the page has no body. Markdown pages are converted on the server and their
|
|
2208
|
+
* headings start at `<h2>` (the page renders its own `<h1>` from `title`).
|
|
2209
|
+
* Render it with `<RichText html={page.contentHtml} />` from
|
|
2210
|
+
* `@behio/storefront-sdk/react`.
|
|
2211
|
+
*/
|
|
2212
|
+
contentHtml: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* @deprecated Read `contentHtml`. The page body as a string: sanitized HTML,
|
|
2215
|
+
* or markdown for older pages written in markdown (convert it yourself).
|
|
2216
|
+
* Kept for storefronts built before SDK 2.20.0.
|
|
2217
|
+
*/
|
|
2218
|
+
content: string;
|
|
2199
2219
|
seoTitle?: string;
|
|
2200
2220
|
seoDescription?: string;
|
|
2201
2221
|
ogTitle?: string;
|
|
@@ -2204,6 +2224,7 @@ interface PageDetail {
|
|
|
2204
2224
|
/** Downloadable files attached to the page (e.g. legal form PDFs). */
|
|
2205
2225
|
attachments: PageAttachment[];
|
|
2206
2226
|
}
|
|
2227
|
+
/** A downloadable file attached to a page. Link to `url`. */
|
|
2207
2228
|
interface PageAttachment {
|
|
2208
2229
|
name: string;
|
|
2209
2230
|
description: string | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-
|
|
2
|
-
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderDiscount, aZ as OrderItem, a_ as OrderListItem, a$ as OrderPaymentInstructions, b0 as OrderPickupPoint, b1 as OrderShipment, b2 as OrderStatus, b3 as OrderStatusHistory, b4 as OrderStatuses, b5 as OrderTracking, b6 as Page, b7 as PageAttachment, b8 as PageDetail, b9 as PaginatedResponse, ba as PaymentInstrument, bb as PaymentStatus, bc as PaymentStatuses, bd as PaymentSwift, be as PickupPoint, bf as PickupPointHours, bg as PickupPointsInput, bh as PickupWidgetConfig, bi as PriceDisplay, bj as ProductAssetGroup, bk as ProductAssetItem, bl as ProductAvailability, bm as ProductGroup, bn as ProductLabel, bo as ProductListItem, bp as ProductMedia, bq as ProductMediaVariant, br as ProductParameter, bs as ProductParameterGroup, bt as ProductParametersResponse, bu as ProductPrice, bv as ProductPromotionSummary, bw as ProductReview, bx as ProductReviewsResponse, by as ProductSibling, bz as ProductSort, bA as ProductSortValue, bB as ProductVolumePrice, bC as ProductsQuery, bD as QuizAnswerInput, bE as QuizAnswerResult, bF as QuizQuestion, bG as QuizResult, bH as QuoteItem, bI as QuoteRequest, bJ as RegisterInput, bK as RegisterResult, bL as RequestInterceptor, bM as RequestInterceptorConfig, bN as ResponseInterceptor, bO as ResponseInterceptorData, bP as ReturnRequest, bQ as ReturnRequestItem, bR as ReturnStatus, bS as ReturnStatusItem, bT as ReturnableOrder, bU as ReturnableOrderItem, bV as SdkError, bW as ShippingMethodSummary, bX as ShippingPublicConfig, bY as ShippingQuote, bZ as ShippingQuoteInput, b_ as ShopAppearance, b$ as ShopCommerce, c0 as ShopInfo, c1 as ShopScript, c2 as ShopScriptPlacement, c3 as ShopScriptType, c4 as ShopScripts, c5 as ShopSeo, c6 as ShopSeoIdentity, c7 as SiteFormField, c8 as SiteFormFieldOption, c9 as SiteFormFieldType, ca as Sitemap, cb as SitemapEntry, cc as StockBehavior, cd as StockMode, ce as StorefrontCollection, cf as StorefrontCollectionField, cg as StorefrontCollectionFieldType, ch as StorefrontCollectionItem, ci as StorefrontCollectionQuery, cj as StorefrontForm, ck as StorefrontFormFieldErrorCode, cl as StorefrontFormFile, cm as StorefrontFormSettings, cn as StorefrontFormSubmitInput, co as StorefrontFormSubmitResult, cp as StorefrontFormUpload, cq as SubmitQuoteInput, cr as SubmitReturnInput, cs as SubmitReviewInput, ct as Subscription, cu as SubscriptionAction, cv as SubscriptionFrequency, cw as SubscriptionItem, cx as SubscriptionStatus, cy as TaxBreakdownLine, cz as VariantAxis, cA as VariantAxisValue, cB as WishlistItem, cC as clearCartSummary, cD as err, cE as ok, cF as publishCartSummary, cG as toSdkError } from './client-
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-B_nmL9ab.mjs';
|
|
2
|
+
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderDiscount, aZ as OrderItem, a_ as OrderListItem, a$ as OrderPaymentInstructions, b0 as OrderPickupPoint, b1 as OrderShipment, b2 as OrderStatus, b3 as OrderStatusHistory, b4 as OrderStatuses, b5 as OrderTracking, b6 as Page, b7 as PageAttachment, b8 as PageDetail, b9 as PaginatedResponse, ba as PaymentInstrument, bb as PaymentStatus, bc as PaymentStatuses, bd as PaymentSwift, be as PickupPoint, bf as PickupPointHours, bg as PickupPointsInput, bh as PickupWidgetConfig, bi as PriceDisplay, bj as ProductAssetGroup, bk as ProductAssetItem, bl as ProductAvailability, bm as ProductGroup, bn as ProductLabel, bo as ProductListItem, bp as ProductMedia, bq as ProductMediaVariant, br as ProductParameter, bs as ProductParameterGroup, bt as ProductParametersResponse, bu as ProductPrice, bv as ProductPromotionSummary, bw as ProductReview, bx as ProductReviewsResponse, by as ProductSibling, bz as ProductSort, bA as ProductSortValue, bB as ProductVolumePrice, bC as ProductsQuery, bD as QuizAnswerInput, bE as QuizAnswerResult, bF as QuizQuestion, bG as QuizResult, bH as QuoteItem, bI as QuoteRequest, bJ as RegisterInput, bK as RegisterResult, bL as RequestInterceptor, bM as RequestInterceptorConfig, bN as ResponseInterceptor, bO as ResponseInterceptorData, bP as ReturnRequest, bQ as ReturnRequestItem, bR as ReturnStatus, bS as ReturnStatusItem, bT as ReturnableOrder, bU as ReturnableOrderItem, bV as SdkError, bW as ShippingMethodSummary, bX as ShippingPublicConfig, bY as ShippingQuote, bZ as ShippingQuoteInput, b_ as ShopAppearance, b$ as ShopCommerce, c0 as ShopInfo, c1 as ShopScript, c2 as ShopScriptPlacement, c3 as ShopScriptType, c4 as ShopScripts, c5 as ShopSeo, c6 as ShopSeoIdentity, c7 as SiteFormField, c8 as SiteFormFieldOption, c9 as SiteFormFieldType, ca as Sitemap, cb as SitemapEntry, cc as StockBehavior, cd as StockMode, ce as StorefrontCollection, cf as StorefrontCollectionField, cg as StorefrontCollectionFieldType, ch as StorefrontCollectionItem, ci as StorefrontCollectionQuery, cj as StorefrontForm, ck as StorefrontFormFieldErrorCode, cl as StorefrontFormFile, cm as StorefrontFormSettings, cn as StorefrontFormSubmitInput, co as StorefrontFormSubmitResult, cp as StorefrontFormUpload, cq as SubmitQuoteInput, cr as SubmitReturnInput, cs as SubmitReviewInput, ct as Subscription, cu as SubscriptionAction, cv as SubscriptionFrequency, cw as SubscriptionItem, cx as SubscriptionStatus, cy as TaxBreakdownLine, cz as VariantAxis, cA as VariantAxisValue, cB as WishlistItem, cC as clearCartSummary, cD as err, cE as ok, cF as publishCartSummary, cG as toSdkError } from './client-B_nmL9ab.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-
|
|
2
|
-
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderDiscount, aZ as OrderItem, a_ as OrderListItem, a$ as OrderPaymentInstructions, b0 as OrderPickupPoint, b1 as OrderShipment, b2 as OrderStatus, b3 as OrderStatusHistory, b4 as OrderStatuses, b5 as OrderTracking, b6 as Page, b7 as PageAttachment, b8 as PageDetail, b9 as PaginatedResponse, ba as PaymentInstrument, bb as PaymentStatus, bc as PaymentStatuses, bd as PaymentSwift, be as PickupPoint, bf as PickupPointHours, bg as PickupPointsInput, bh as PickupWidgetConfig, bi as PriceDisplay, bj as ProductAssetGroup, bk as ProductAssetItem, bl as ProductAvailability, bm as ProductGroup, bn as ProductLabel, bo as ProductListItem, bp as ProductMedia, bq as ProductMediaVariant, br as ProductParameter, bs as ProductParameterGroup, bt as ProductParametersResponse, bu as ProductPrice, bv as ProductPromotionSummary, bw as ProductReview, bx as ProductReviewsResponse, by as ProductSibling, bz as ProductSort, bA as ProductSortValue, bB as ProductVolumePrice, bC as ProductsQuery, bD as QuizAnswerInput, bE as QuizAnswerResult, bF as QuizQuestion, bG as QuizResult, bH as QuoteItem, bI as QuoteRequest, bJ as RegisterInput, bK as RegisterResult, bL as RequestInterceptor, bM as RequestInterceptorConfig, bN as ResponseInterceptor, bO as ResponseInterceptorData, bP as ReturnRequest, bQ as ReturnRequestItem, bR as ReturnStatus, bS as ReturnStatusItem, bT as ReturnableOrder, bU as ReturnableOrderItem, bV as SdkError, bW as ShippingMethodSummary, bX as ShippingPublicConfig, bY as ShippingQuote, bZ as ShippingQuoteInput, b_ as ShopAppearance, b$ as ShopCommerce, c0 as ShopInfo, c1 as ShopScript, c2 as ShopScriptPlacement, c3 as ShopScriptType, c4 as ShopScripts, c5 as ShopSeo, c6 as ShopSeoIdentity, c7 as SiteFormField, c8 as SiteFormFieldOption, c9 as SiteFormFieldType, ca as Sitemap, cb as SitemapEntry, cc as StockBehavior, cd as StockMode, ce as StorefrontCollection, cf as StorefrontCollectionField, cg as StorefrontCollectionFieldType, ch as StorefrontCollectionItem, ci as StorefrontCollectionQuery, cj as StorefrontForm, ck as StorefrontFormFieldErrorCode, cl as StorefrontFormFile, cm as StorefrontFormSettings, cn as StorefrontFormSubmitInput, co as StorefrontFormSubmitResult, cp as StorefrontFormUpload, cq as SubmitQuoteInput, cr as SubmitReturnInput, cs as SubmitReviewInput, ct as Subscription, cu as SubscriptionAction, cv as SubscriptionFrequency, cw as SubscriptionItem, cx as SubscriptionStatus, cy as TaxBreakdownLine, cz as VariantAxis, cA as VariantAxisValue, cB as WishlistItem, cC as clearCartSummary, cD as err, cE as ok, cF as publishCartSummary, cG as toSdkError } from './client-
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-B_nmL9ab.js';
|
|
2
|
+
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderDiscount, aZ as OrderItem, a_ as OrderListItem, a$ as OrderPaymentInstructions, b0 as OrderPickupPoint, b1 as OrderShipment, b2 as OrderStatus, b3 as OrderStatusHistory, b4 as OrderStatuses, b5 as OrderTracking, b6 as Page, b7 as PageAttachment, b8 as PageDetail, b9 as PaginatedResponse, ba as PaymentInstrument, bb as PaymentStatus, bc as PaymentStatuses, bd as PaymentSwift, be as PickupPoint, bf as PickupPointHours, bg as PickupPointsInput, bh as PickupWidgetConfig, bi as PriceDisplay, bj as ProductAssetGroup, bk as ProductAssetItem, bl as ProductAvailability, bm as ProductGroup, bn as ProductLabel, bo as ProductListItem, bp as ProductMedia, bq as ProductMediaVariant, br as ProductParameter, bs as ProductParameterGroup, bt as ProductParametersResponse, bu as ProductPrice, bv as ProductPromotionSummary, bw as ProductReview, bx as ProductReviewsResponse, by as ProductSibling, bz as ProductSort, bA as ProductSortValue, bB as ProductVolumePrice, bC as ProductsQuery, bD as QuizAnswerInput, bE as QuizAnswerResult, bF as QuizQuestion, bG as QuizResult, bH as QuoteItem, bI as QuoteRequest, bJ as RegisterInput, bK as RegisterResult, bL as RequestInterceptor, bM as RequestInterceptorConfig, bN as ResponseInterceptor, bO as ResponseInterceptorData, bP as ReturnRequest, bQ as ReturnRequestItem, bR as ReturnStatus, bS as ReturnStatusItem, bT as ReturnableOrder, bU as ReturnableOrderItem, bV as SdkError, bW as ShippingMethodSummary, bX as ShippingPublicConfig, bY as ShippingQuote, bZ as ShippingQuoteInput, b_ as ShopAppearance, b$ as ShopCommerce, c0 as ShopInfo, c1 as ShopScript, c2 as ShopScriptPlacement, c3 as ShopScriptType, c4 as ShopScripts, c5 as ShopSeo, c6 as ShopSeoIdentity, c7 as SiteFormField, c8 as SiteFormFieldOption, c9 as SiteFormFieldType, ca as Sitemap, cb as SitemapEntry, cc as StockBehavior, cd as StockMode, ce as StorefrontCollection, cf as StorefrontCollectionField, cg as StorefrontCollectionFieldType, ch as StorefrontCollectionItem, ci as StorefrontCollectionQuery, cj as StorefrontForm, ck as StorefrontFormFieldErrorCode, cl as StorefrontFormFile, cm as StorefrontFormSettings, cn as StorefrontFormSubmitInput, co as StorefrontFormSubmitResult, cp as StorefrontFormUpload, cq as SubmitQuoteInput, cr as SubmitReturnInput, cs as SubmitReviewInput, ct as Subscription, cu as SubscriptionAction, cv as SubscriptionFrequency, cw as SubscriptionItem, cx as SubscriptionStatus, cy as TaxBreakdownLine, cz as VariantAxis, cA as VariantAxisValue, cB as WishlistItem, cC as clearCartSummary, cD as err, cE as ok, cF as publishCartSummary, cG as toSdkError } from './client-B_nmL9ab.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-B_nmL9ab.mjs';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-B_nmL9ab.js';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/react.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
4
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
5
|
+
import * as react from 'react';
|
|
5
6
|
|
|
6
7
|
interface StorageAdapter {
|
|
7
8
|
get(key: string): string | null;
|
|
@@ -265,6 +266,13 @@ interface ShopInfo {
|
|
|
265
266
|
};
|
|
266
267
|
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
267
268
|
commerce?: ShopCommerce;
|
|
269
|
+
/**
|
|
270
|
+
* IANA time zone of the site (SDK 2.19.0), e.g. "Europe/Prague". Format dates
|
|
271
|
+
* with `Intl.DateTimeFormat(locale, {timeZone})` so the server render and the
|
|
272
|
+
* browser agree (no hydration mismatch) and show the merchant's day. Optional
|
|
273
|
+
* because cached payloads predating 2.19.0 may still be served.
|
|
274
|
+
*/
|
|
275
|
+
timezone?: string;
|
|
268
276
|
id: string;
|
|
269
277
|
name: string;
|
|
270
278
|
domain: string;
|
|
@@ -2251,7 +2259,20 @@ interface Page {
|
|
|
2251
2259
|
interface PageDetail {
|
|
2252
2260
|
slug: string;
|
|
2253
2261
|
title: string;
|
|
2254
|
-
|
|
2262
|
+
/**
|
|
2263
|
+
* Page body as ready to render, sanitized HTML. Always a string, empty when
|
|
2264
|
+
* the page has no body. Markdown pages are converted on the server and their
|
|
2265
|
+
* headings start at `<h2>` (the page renders its own `<h1>` from `title`).
|
|
2266
|
+
* Render it with `<RichText html={page.contentHtml} />` from
|
|
2267
|
+
* `@behio/storefront-sdk/react`.
|
|
2268
|
+
*/
|
|
2269
|
+
contentHtml: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* @deprecated Read `contentHtml`. The page body as a string: sanitized HTML,
|
|
2272
|
+
* or markdown for older pages written in markdown (convert it yourself).
|
|
2273
|
+
* Kept for storefronts built before SDK 2.20.0.
|
|
2274
|
+
*/
|
|
2275
|
+
content: string;
|
|
2255
2276
|
seoTitle?: string;
|
|
2256
2277
|
seoDescription?: string;
|
|
2257
2278
|
ogTitle?: string;
|
|
@@ -2260,6 +2281,7 @@ interface PageDetail {
|
|
|
2260
2281
|
/** Downloadable files attached to the page (e.g. legal form PDFs). */
|
|
2261
2282
|
attachments: PageAttachment[];
|
|
2262
2283
|
}
|
|
2284
|
+
/** A downloadable file attached to a page. Link to `url`. */
|
|
2263
2285
|
interface PageAttachment {
|
|
2264
2286
|
name: string;
|
|
2265
2287
|
description: string | null;
|
|
@@ -5267,6 +5289,42 @@ declare function StorefrontScripts({ visitorId: visitorIdProp, initialScripts }?
|
|
|
5267
5289
|
*/
|
|
5268
5290
|
declare function BehioAnalyticsTracker(): null;
|
|
5269
5291
|
|
|
5292
|
+
interface RichTextProps {
|
|
5293
|
+
/**
|
|
5294
|
+
* HTML from a Behio API field that the API already sanitizes on read:
|
|
5295
|
+
* `page.contentHtml`, a blog post's `content.html`, product
|
|
5296
|
+
* `shortDescription` / `longDescription`. Empty or missing renders nothing.
|
|
5297
|
+
*/
|
|
5298
|
+
html?: string | null;
|
|
5299
|
+
/** Extra class names; the element always carries `behio-rich-text`. */
|
|
5300
|
+
className?: string;
|
|
5301
|
+
/** Wrapper element. Default: "div". */
|
|
5302
|
+
as?: "div" | "article" | "section";
|
|
5303
|
+
}
|
|
5304
|
+
/**
|
|
5305
|
+
* Renders merchant rich text (CMS pages, blog posts, product descriptions).
|
|
5306
|
+
*
|
|
5307
|
+
* The HTML is inserted as is with `dangerouslySetInnerHTML`. That is safe only
|
|
5308
|
+
* because the Behio API sanitizes these fields on the server before it sends
|
|
5309
|
+
* them (scripts, event handlers, `javascript:` links and unsafe inline styles
|
|
5310
|
+
* are removed). Use it ONLY for the API fields listed on `html`, never for
|
|
5311
|
+
* HTML from a visitor, a query string or another service.
|
|
5312
|
+
*
|
|
5313
|
+
* Style the content with the `.behio-rich-text` class (headings, lists,
|
|
5314
|
+
* tables, images and the `bh-*` story blocks the editor produces).
|
|
5315
|
+
*
|
|
5316
|
+
* @example
|
|
5317
|
+
* const { data: page } = await client.pages.get(slug, locale);
|
|
5318
|
+
* <h1>{page.title}</h1>
|
|
5319
|
+
* <RichText html={page.contentHtml} as="article" />
|
|
5320
|
+
*/
|
|
5321
|
+
declare function RichText({ html, className, as }: RichTextProps): react.DetailedReactHTMLElement<{
|
|
5322
|
+
className: string;
|
|
5323
|
+
dangerouslySetInnerHTML: {
|
|
5324
|
+
__html: string;
|
|
5325
|
+
};
|
|
5326
|
+
}, HTMLElement> | null;
|
|
5327
|
+
|
|
5270
5328
|
/** List all active bundles. */
|
|
5271
5329
|
declare function useBundles(options?: BundleCatalogQuery & {
|
|
5272
5330
|
enabled?: boolean;
|
|
@@ -5925,4 +5983,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
5925
5983
|
success: boolean;
|
|
5926
5984
|
}>>;
|
|
5927
5985
|
|
|
5928
|
-
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
|
5986
|
+
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
package/dist/react.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
4
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
5
|
+
import * as react from 'react';
|
|
5
6
|
|
|
6
7
|
interface StorageAdapter {
|
|
7
8
|
get(key: string): string | null;
|
|
@@ -265,6 +266,13 @@ interface ShopInfo {
|
|
|
265
266
|
};
|
|
266
267
|
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
267
268
|
commerce?: ShopCommerce;
|
|
269
|
+
/**
|
|
270
|
+
* IANA time zone of the site (SDK 2.19.0), e.g. "Europe/Prague". Format dates
|
|
271
|
+
* with `Intl.DateTimeFormat(locale, {timeZone})` so the server render and the
|
|
272
|
+
* browser agree (no hydration mismatch) and show the merchant's day. Optional
|
|
273
|
+
* because cached payloads predating 2.19.0 may still be served.
|
|
274
|
+
*/
|
|
275
|
+
timezone?: string;
|
|
268
276
|
id: string;
|
|
269
277
|
name: string;
|
|
270
278
|
domain: string;
|
|
@@ -2251,7 +2259,20 @@ interface Page {
|
|
|
2251
2259
|
interface PageDetail {
|
|
2252
2260
|
slug: string;
|
|
2253
2261
|
title: string;
|
|
2254
|
-
|
|
2262
|
+
/**
|
|
2263
|
+
* Page body as ready to render, sanitized HTML. Always a string, empty when
|
|
2264
|
+
* the page has no body. Markdown pages are converted on the server and their
|
|
2265
|
+
* headings start at `<h2>` (the page renders its own `<h1>` from `title`).
|
|
2266
|
+
* Render it with `<RichText html={page.contentHtml} />` from
|
|
2267
|
+
* `@behio/storefront-sdk/react`.
|
|
2268
|
+
*/
|
|
2269
|
+
contentHtml: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* @deprecated Read `contentHtml`. The page body as a string: sanitized HTML,
|
|
2272
|
+
* or markdown for older pages written in markdown (convert it yourself).
|
|
2273
|
+
* Kept for storefronts built before SDK 2.20.0.
|
|
2274
|
+
*/
|
|
2275
|
+
content: string;
|
|
2255
2276
|
seoTitle?: string;
|
|
2256
2277
|
seoDescription?: string;
|
|
2257
2278
|
ogTitle?: string;
|
|
@@ -2260,6 +2281,7 @@ interface PageDetail {
|
|
|
2260
2281
|
/** Downloadable files attached to the page (e.g. legal form PDFs). */
|
|
2261
2282
|
attachments: PageAttachment[];
|
|
2262
2283
|
}
|
|
2284
|
+
/** A downloadable file attached to a page. Link to `url`. */
|
|
2263
2285
|
interface PageAttachment {
|
|
2264
2286
|
name: string;
|
|
2265
2287
|
description: string | null;
|
|
@@ -5267,6 +5289,42 @@ declare function StorefrontScripts({ visitorId: visitorIdProp, initialScripts }?
|
|
|
5267
5289
|
*/
|
|
5268
5290
|
declare function BehioAnalyticsTracker(): null;
|
|
5269
5291
|
|
|
5292
|
+
interface RichTextProps {
|
|
5293
|
+
/**
|
|
5294
|
+
* HTML from a Behio API field that the API already sanitizes on read:
|
|
5295
|
+
* `page.contentHtml`, a blog post's `content.html`, product
|
|
5296
|
+
* `shortDescription` / `longDescription`. Empty or missing renders nothing.
|
|
5297
|
+
*/
|
|
5298
|
+
html?: string | null;
|
|
5299
|
+
/** Extra class names; the element always carries `behio-rich-text`. */
|
|
5300
|
+
className?: string;
|
|
5301
|
+
/** Wrapper element. Default: "div". */
|
|
5302
|
+
as?: "div" | "article" | "section";
|
|
5303
|
+
}
|
|
5304
|
+
/**
|
|
5305
|
+
* Renders merchant rich text (CMS pages, blog posts, product descriptions).
|
|
5306
|
+
*
|
|
5307
|
+
* The HTML is inserted as is with `dangerouslySetInnerHTML`. That is safe only
|
|
5308
|
+
* because the Behio API sanitizes these fields on the server before it sends
|
|
5309
|
+
* them (scripts, event handlers, `javascript:` links and unsafe inline styles
|
|
5310
|
+
* are removed). Use it ONLY for the API fields listed on `html`, never for
|
|
5311
|
+
* HTML from a visitor, a query string or another service.
|
|
5312
|
+
*
|
|
5313
|
+
* Style the content with the `.behio-rich-text` class (headings, lists,
|
|
5314
|
+
* tables, images and the `bh-*` story blocks the editor produces).
|
|
5315
|
+
*
|
|
5316
|
+
* @example
|
|
5317
|
+
* const { data: page } = await client.pages.get(slug, locale);
|
|
5318
|
+
* <h1>{page.title}</h1>
|
|
5319
|
+
* <RichText html={page.contentHtml} as="article" />
|
|
5320
|
+
*/
|
|
5321
|
+
declare function RichText({ html, className, as }: RichTextProps): react.DetailedReactHTMLElement<{
|
|
5322
|
+
className: string;
|
|
5323
|
+
dangerouslySetInnerHTML: {
|
|
5324
|
+
__html: string;
|
|
5325
|
+
};
|
|
5326
|
+
}, HTMLElement> | null;
|
|
5327
|
+
|
|
5270
5328
|
/** List all active bundles. */
|
|
5271
5329
|
declare function useBundles(options?: BundleCatalogQuery & {
|
|
5272
5330
|
enabled?: boolean;
|
|
@@ -5925,4 +5983,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
5925
5983
|
success: boolean;
|
|
5926
5984
|
}>>;
|
|
5927
5985
|
|
|
5928
|
-
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
|
5986
|
+
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
package/dist/react.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(react_exports, {
|
|
|
24
24
|
BehioAnalyticsTracker: () => BehioAnalyticsTracker,
|
|
25
25
|
BehioProvider: () => BehioProvider,
|
|
26
26
|
CurrencySwitcher: () => CurrencySwitcher,
|
|
27
|
+
RichText: () => RichText,
|
|
27
28
|
StorefrontScripts: () => StorefrontScripts,
|
|
28
29
|
cookieStorage: () => cookieStorage,
|
|
29
30
|
createMemoryStorage: () => createMemoryStorage,
|
|
@@ -4683,6 +4684,16 @@ function utmFromSearch(search) {
|
|
|
4683
4684
|
}
|
|
4684
4685
|
}
|
|
4685
4686
|
|
|
4687
|
+
// src/react/components/rich-text.tsx
|
|
4688
|
+
var import_react20 = require("react");
|
|
4689
|
+
function RichText({ html, className, as = "div" }) {
|
|
4690
|
+
if (!html) return null;
|
|
4691
|
+
return (0, import_react20.createElement)(as, {
|
|
4692
|
+
className: className ? `behio-rich-text ${className}` : "behio-rich-text",
|
|
4693
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
4694
|
+
});
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4686
4697
|
// src/react/hooks/use-bundles.ts
|
|
4687
4698
|
var import_react_query43 = require("@tanstack/react-query");
|
|
4688
4699
|
function useBundles(options) {
|
|
@@ -4991,6 +5002,7 @@ async function revokeAnalyticsConsent(client) {
|
|
|
4991
5002
|
BehioAnalyticsTracker,
|
|
4992
5003
|
BehioProvider,
|
|
4993
5004
|
CurrencySwitcher,
|
|
5005
|
+
RichText,
|
|
4994
5006
|
StorefrontScripts,
|
|
4995
5007
|
cookieStorage,
|
|
4996
5008
|
createMemoryStorage,
|
package/dist/react.mjs
CHANGED
|
@@ -4571,6 +4571,16 @@ function utmFromSearch(search) {
|
|
|
4571
4571
|
}
|
|
4572
4572
|
}
|
|
4573
4573
|
|
|
4574
|
+
// src/react/components/rich-text.tsx
|
|
4575
|
+
import { createElement } from "react";
|
|
4576
|
+
function RichText({ html, className, as = "div" }) {
|
|
4577
|
+
if (!html) return null;
|
|
4578
|
+
return createElement(as, {
|
|
4579
|
+
className: className ? `behio-rich-text ${className}` : "behio-rich-text",
|
|
4580
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
4581
|
+
});
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4574
4584
|
// src/react/hooks/use-bundles.ts
|
|
4575
4585
|
import { useQuery as useQuery37 } from "@tanstack/react-query";
|
|
4576
4586
|
function useBundles(options) {
|
|
@@ -4878,6 +4888,7 @@ export {
|
|
|
4878
4888
|
BehioAnalyticsTracker,
|
|
4879
4889
|
BehioProvider,
|
|
4880
4890
|
CurrencySwitcher,
|
|
4891
|
+
RichText,
|
|
4881
4892
|
StorefrontScripts,
|
|
4882
4893
|
cookieStorage,
|
|
4883
4894
|
createMemoryStorage,
|