@reblu/site-blocks 0.23.0 → 0.25.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 +26 -0
- package/README.md +56 -6
- package/dist/index.cjs +418 -328
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -3
- package/dist/index.d.ts +64 -3
- package/dist/index.js +416 -328
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, 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,47 @@ 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
|
+
type Guarantee = NonNullable<AcademyCourseDetail['refundGuarantee']>;
|
|
323
|
+
/** Texts of {@link CoursePurchaseTerms}; replace any of them in the SITE's language. */
|
|
324
|
+
interface CoursePurchaseTermsLabels {
|
|
325
|
+
/** Shown when checkout asks for the withdrawal waiver. */
|
|
326
|
+
withdrawalWaiver: ReactNode;
|
|
327
|
+
/** Months of access after enrolment. */
|
|
328
|
+
accessDuration: (months: number) => ReactNode;
|
|
329
|
+
/** The refund guarantee terms. */
|
|
330
|
+
refundGuarantee: (guarantee: Guarantee) => ReactNode;
|
|
331
|
+
}
|
|
332
|
+
declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
|
|
333
|
+
/**
|
|
334
|
+
* `CoursePurchaseTerms` — the drop-in for what a buyer must see before paying
|
|
335
|
+
* for a course (`client.academy.bySlug()`), REB-1199:
|
|
336
|
+
* `withdrawalWaiverRequired`, `accessDurationMonths` and `refundGuarantee`.
|
|
337
|
+
*
|
|
338
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
339
|
+
*
|
|
340
|
+
* Each term renders only when the course carries it; with none (or against an
|
|
341
|
+
* API that predates them) the block renders NOTHING, not even the heading.
|
|
342
|
+
* The default copy is Spanish and neutral; pass `labels` to replace any text.
|
|
343
|
+
*/
|
|
344
|
+
interface CoursePurchaseTermsProps {
|
|
345
|
+
/** The fields of `AcademyCourseDetail` this block reads (all optional). */
|
|
346
|
+
course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'accessDurationMonths' | 'refundGuarantee'>>;
|
|
347
|
+
/** Optional section heading, e.g. «Antes de comprar». */
|
|
348
|
+
heading?: ReactNode;
|
|
349
|
+
/** Level of `heading`. Defaults to `2`. */
|
|
350
|
+
headingLevel?: HeadingLevel;
|
|
351
|
+
/** `id` of the heading element (the section's `aria-labelledby`). */
|
|
352
|
+
headingId?: string;
|
|
353
|
+
labels?: Partial<CoursePurchaseTermsLabels>;
|
|
354
|
+
/** Classes for the outer element (added to its `space-y-2` layout). */
|
|
355
|
+
className?: string;
|
|
356
|
+
/** Classes for the heading; REPLACE the default `text-lg font-semibold`. */
|
|
357
|
+
headingClassName?: string;
|
|
358
|
+
/** Classes for the list; REPLACE the default `text-sm text-muted-foreground`. */
|
|
359
|
+
listClassName?: string;
|
|
360
|
+
}
|
|
361
|
+
declare function CoursePurchaseTerms({ course, heading, headingLevel, headingId, labels, className, headingClassName, listClassName, }: CoursePurchaseTermsProps): react_jsx_runtime.JSX.Element | null;
|
|
362
|
+
|
|
322
363
|
/**
|
|
323
364
|
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
365
|
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
@@ -830,6 +871,13 @@ declare function ShopFilters({ facets, hrefs, active, onChange, priceBands, labe
|
|
|
830
871
|
* picking a band turns «Gratis» off; a consumer building `hrefs` should do the
|
|
831
872
|
* same (drop `free` in `hrefs.price`, drop the range in `hrefs.free(true)`).
|
|
832
873
|
*
|
|
874
|
+
* Which filters show is tenant config (REB-1234): pass
|
|
875
|
+
* `(await client.academy.config()).catalogFilters` as `enabled`. A filter left
|
|
876
|
+
* out of `enabled` shows, so omitting the prop keeps every filter. The category
|
|
877
|
+
* filter also needs `categories` (from `client.academy.categories()`) and
|
|
878
|
+
* `hrefs.category`. With every filter off, nothing renders; the search box is
|
|
879
|
+
* the SITE's own and stays.
|
|
880
|
+
*
|
|
833
881
|
* Tokens only, Spanish defaults, every label overridable.
|
|
834
882
|
*/
|
|
835
883
|
/** One price band. `min`/`max` are integer cents; either may be omitted for an open end. */
|
|
@@ -843,6 +891,8 @@ interface CourseCatalogPriceBand {
|
|
|
843
891
|
declare const DEFAULT_COURSE_PRICE_BANDS: CourseCatalogPriceBand[];
|
|
844
892
|
/** The selection currently reflected in the URL (or component state). */
|
|
845
893
|
interface CourseCatalogFiltersActive {
|
|
894
|
+
/** A category slug (`AcademyCategoryPublic.slug`). */
|
|
895
|
+
category?: string;
|
|
846
896
|
/** An instructor id (`AcademyInstructorPublic.id`). */
|
|
847
897
|
instructor?: string;
|
|
848
898
|
priceMin?: number;
|
|
@@ -851,6 +901,8 @@ interface CourseCatalogFiltersActive {
|
|
|
851
901
|
}
|
|
852
902
|
/** Href generators — the RSC-safe navigation seam. Keep the other current params. */
|
|
853
903
|
interface CourseCatalogFiltersHrefs {
|
|
904
|
+
/** `slug` undefined clears the category filter. Required to show the category filter. */
|
|
905
|
+
category?: (slug: string | undefined) => string;
|
|
854
906
|
/** `id` undefined clears the instructor filter. */
|
|
855
907
|
instructor: (id: string | undefined) => string;
|
|
856
908
|
/** Both undefined clears the price range. Should also drop `free`. */
|
|
@@ -860,6 +912,8 @@ interface CourseCatalogFiltersHrefs {
|
|
|
860
912
|
clearAll: () => string;
|
|
861
913
|
}
|
|
862
914
|
interface CourseCatalogFiltersLabels {
|
|
915
|
+
category: string;
|
|
916
|
+
allCategories: string;
|
|
863
917
|
instructor: string;
|
|
864
918
|
allInstructors: string;
|
|
865
919
|
price: string;
|
|
@@ -873,6 +927,13 @@ declare const DEFAULT_COURSE_CATALOG_FILTERS_LABELS: CourseCatalogFiltersLabels;
|
|
|
873
927
|
interface CourseCatalogFiltersProps {
|
|
874
928
|
/** From `client.academy.instructors()`. Unnamed instructors are not offered. */
|
|
875
929
|
instructors: AcademyInstructorPublic[];
|
|
930
|
+
/** From `client.academy.categories()`. Shown in `sortOrder` order. */
|
|
931
|
+
categories?: AcademyCategoryPublic[];
|
|
932
|
+
/**
|
|
933
|
+
* Which filters the tenant switched on — `client.academy.config()`'s
|
|
934
|
+
* `catalogFilters`. A missing key counts as on.
|
|
935
|
+
*/
|
|
936
|
+
enabled?: Partial<AcademyCatalogFiltersPublic>;
|
|
876
937
|
hrefs: CourseCatalogFiltersHrefs;
|
|
877
938
|
active?: CourseCatalogFiltersActive;
|
|
878
939
|
/** Client-only: intercepts navigation with a callback instead. */
|
|
@@ -884,7 +945,7 @@ interface CourseCatalogFiltersProps {
|
|
|
884
945
|
locale?: string;
|
|
885
946
|
className?: string;
|
|
886
947
|
}
|
|
887
|
-
declare function CourseCatalogFilters({ instructors, hrefs, active, onChange, priceBands, labels, currencyCode, locale, className, }: CourseCatalogFiltersProps): react_jsx_runtime.JSX.Element;
|
|
948
|
+
declare function CourseCatalogFilters({ instructors, categories, enabled, hrefs, active, onChange, priceBands, labels, currencyCode, locale, className, }: CourseCatalogFiltersProps): react_jsx_runtime.JSX.Element | null;
|
|
888
949
|
|
|
889
950
|
/**
|
|
890
951
|
* `CartLineList` — presentational cart lines (REB-829), container/
|
|
@@ -1444,4 +1505,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1444
1505
|
}
|
|
1445
1506
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1446
1507
|
|
|
1447
|
-
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, 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 };
|
|
1508
|
+
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, 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, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, 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,47 @@ 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
|
+
type Guarantee = NonNullable<AcademyCourseDetail['refundGuarantee']>;
|
|
323
|
+
/** Texts of {@link CoursePurchaseTerms}; replace any of them in the SITE's language. */
|
|
324
|
+
interface CoursePurchaseTermsLabels {
|
|
325
|
+
/** Shown when checkout asks for the withdrawal waiver. */
|
|
326
|
+
withdrawalWaiver: ReactNode;
|
|
327
|
+
/** Months of access after enrolment. */
|
|
328
|
+
accessDuration: (months: number) => ReactNode;
|
|
329
|
+
/** The refund guarantee terms. */
|
|
330
|
+
refundGuarantee: (guarantee: Guarantee) => ReactNode;
|
|
331
|
+
}
|
|
332
|
+
declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
|
|
333
|
+
/**
|
|
334
|
+
* `CoursePurchaseTerms` — the drop-in for what a buyer must see before paying
|
|
335
|
+
* for a course (`client.academy.bySlug()`), REB-1199:
|
|
336
|
+
* `withdrawalWaiverRequired`, `accessDurationMonths` and `refundGuarantee`.
|
|
337
|
+
*
|
|
338
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
339
|
+
*
|
|
340
|
+
* Each term renders only when the course carries it; with none (or against an
|
|
341
|
+
* API that predates them) the block renders NOTHING, not even the heading.
|
|
342
|
+
* The default copy is Spanish and neutral; pass `labels` to replace any text.
|
|
343
|
+
*/
|
|
344
|
+
interface CoursePurchaseTermsProps {
|
|
345
|
+
/** The fields of `AcademyCourseDetail` this block reads (all optional). */
|
|
346
|
+
course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'accessDurationMonths' | 'refundGuarantee'>>;
|
|
347
|
+
/** Optional section heading, e.g. «Antes de comprar». */
|
|
348
|
+
heading?: ReactNode;
|
|
349
|
+
/** Level of `heading`. Defaults to `2`. */
|
|
350
|
+
headingLevel?: HeadingLevel;
|
|
351
|
+
/** `id` of the heading element (the section's `aria-labelledby`). */
|
|
352
|
+
headingId?: string;
|
|
353
|
+
labels?: Partial<CoursePurchaseTermsLabels>;
|
|
354
|
+
/** Classes for the outer element (added to its `space-y-2` layout). */
|
|
355
|
+
className?: string;
|
|
356
|
+
/** Classes for the heading; REPLACE the default `text-lg font-semibold`. */
|
|
357
|
+
headingClassName?: string;
|
|
358
|
+
/** Classes for the list; REPLACE the default `text-sm text-muted-foreground`. */
|
|
359
|
+
listClassName?: string;
|
|
360
|
+
}
|
|
361
|
+
declare function CoursePurchaseTerms({ course, heading, headingLevel, headingId, labels, className, headingClassName, listClassName, }: CoursePurchaseTermsProps): react_jsx_runtime.JSX.Element | null;
|
|
362
|
+
|
|
322
363
|
/**
|
|
323
364
|
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
365
|
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
@@ -830,6 +871,13 @@ declare function ShopFilters({ facets, hrefs, active, onChange, priceBands, labe
|
|
|
830
871
|
* picking a band turns «Gratis» off; a consumer building `hrefs` should do the
|
|
831
872
|
* same (drop `free` in `hrefs.price`, drop the range in `hrefs.free(true)`).
|
|
832
873
|
*
|
|
874
|
+
* Which filters show is tenant config (REB-1234): pass
|
|
875
|
+
* `(await client.academy.config()).catalogFilters` as `enabled`. A filter left
|
|
876
|
+
* out of `enabled` shows, so omitting the prop keeps every filter. The category
|
|
877
|
+
* filter also needs `categories` (from `client.academy.categories()`) and
|
|
878
|
+
* `hrefs.category`. With every filter off, nothing renders; the search box is
|
|
879
|
+
* the SITE's own and stays.
|
|
880
|
+
*
|
|
833
881
|
* Tokens only, Spanish defaults, every label overridable.
|
|
834
882
|
*/
|
|
835
883
|
/** One price band. `min`/`max` are integer cents; either may be omitted for an open end. */
|
|
@@ -843,6 +891,8 @@ interface CourseCatalogPriceBand {
|
|
|
843
891
|
declare const DEFAULT_COURSE_PRICE_BANDS: CourseCatalogPriceBand[];
|
|
844
892
|
/** The selection currently reflected in the URL (or component state). */
|
|
845
893
|
interface CourseCatalogFiltersActive {
|
|
894
|
+
/** A category slug (`AcademyCategoryPublic.slug`). */
|
|
895
|
+
category?: string;
|
|
846
896
|
/** An instructor id (`AcademyInstructorPublic.id`). */
|
|
847
897
|
instructor?: string;
|
|
848
898
|
priceMin?: number;
|
|
@@ -851,6 +901,8 @@ interface CourseCatalogFiltersActive {
|
|
|
851
901
|
}
|
|
852
902
|
/** Href generators — the RSC-safe navigation seam. Keep the other current params. */
|
|
853
903
|
interface CourseCatalogFiltersHrefs {
|
|
904
|
+
/** `slug` undefined clears the category filter. Required to show the category filter. */
|
|
905
|
+
category?: (slug: string | undefined) => string;
|
|
854
906
|
/** `id` undefined clears the instructor filter. */
|
|
855
907
|
instructor: (id: string | undefined) => string;
|
|
856
908
|
/** Both undefined clears the price range. Should also drop `free`. */
|
|
@@ -860,6 +912,8 @@ interface CourseCatalogFiltersHrefs {
|
|
|
860
912
|
clearAll: () => string;
|
|
861
913
|
}
|
|
862
914
|
interface CourseCatalogFiltersLabels {
|
|
915
|
+
category: string;
|
|
916
|
+
allCategories: string;
|
|
863
917
|
instructor: string;
|
|
864
918
|
allInstructors: string;
|
|
865
919
|
price: string;
|
|
@@ -873,6 +927,13 @@ declare const DEFAULT_COURSE_CATALOG_FILTERS_LABELS: CourseCatalogFiltersLabels;
|
|
|
873
927
|
interface CourseCatalogFiltersProps {
|
|
874
928
|
/** From `client.academy.instructors()`. Unnamed instructors are not offered. */
|
|
875
929
|
instructors: AcademyInstructorPublic[];
|
|
930
|
+
/** From `client.academy.categories()`. Shown in `sortOrder` order. */
|
|
931
|
+
categories?: AcademyCategoryPublic[];
|
|
932
|
+
/**
|
|
933
|
+
* Which filters the tenant switched on — `client.academy.config()`'s
|
|
934
|
+
* `catalogFilters`. A missing key counts as on.
|
|
935
|
+
*/
|
|
936
|
+
enabled?: Partial<AcademyCatalogFiltersPublic>;
|
|
876
937
|
hrefs: CourseCatalogFiltersHrefs;
|
|
877
938
|
active?: CourseCatalogFiltersActive;
|
|
878
939
|
/** Client-only: intercepts navigation with a callback instead. */
|
|
@@ -884,7 +945,7 @@ interface CourseCatalogFiltersProps {
|
|
|
884
945
|
locale?: string;
|
|
885
946
|
className?: string;
|
|
886
947
|
}
|
|
887
|
-
declare function CourseCatalogFilters({ instructors, hrefs, active, onChange, priceBands, labels, currencyCode, locale, className, }: CourseCatalogFiltersProps): react_jsx_runtime.JSX.Element;
|
|
948
|
+
declare function CourseCatalogFilters({ instructors, categories, enabled, hrefs, active, onChange, priceBands, labels, currencyCode, locale, className, }: CourseCatalogFiltersProps): react_jsx_runtime.JSX.Element | null;
|
|
888
949
|
|
|
889
950
|
/**
|
|
890
951
|
* `CartLineList` — presentational cart lines (REB-829), container/
|
|
@@ -1444,4 +1505,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1444
1505
|
}
|
|
1445
1506
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1446
1507
|
|
|
1447
|
-
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, 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 };
|
|
1508
|
+
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, 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 };
|