@reblu/site-blocks 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +84 -14
- package/dist/client.cjs +218 -83
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +40 -13
- package/dist/client.d.ts +40 -13
- package/dist/client.js +221 -86
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +421 -301
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -2
- package/dist/index.d.ts +45 -2
- package/dist/index.js +419 -301
- 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, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.cjs';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.cjs';
|
|
@@ -319,6 +319,49 @@ interface CourseDescriptionProps {
|
|
|
319
319
|
}
|
|
320
320
|
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
|
+
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
325
|
+
* `GET /api/site/academy/courses/{slug}/lessons/{lessonSlug}`.
|
|
326
|
+
*
|
|
327
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`, no player
|
|
328
|
+
* dependency. The video is the provider's hosted player in an `<iframe>`
|
|
329
|
+
* (`video.embedUrl`, already carrying its short-lived token), so the SDK pulls
|
|
330
|
+
* in no video library and a SITE needs no player code. Only an `https:` URL is
|
|
331
|
+
* ever embedded.
|
|
332
|
+
*
|
|
333
|
+
* The body (`content`, Markdown) goes through the same pipeline as
|
|
334
|
+
* `CourseDescription` / `MarkdownRenderer` (`marked` → hast-util-sanitize):
|
|
335
|
+
* never raw HTML, no scripts, no `javascript:` links. Its own headings sit one
|
|
336
|
+
* level below the lesson title.
|
|
337
|
+
*
|
|
338
|
+
* CSP note for the SITE: the player needs `frame-src https://player.mux.com`.
|
|
339
|
+
*/
|
|
340
|
+
interface LessonPreviewLabels {
|
|
341
|
+
/** Badge above the title. */
|
|
342
|
+
badge: string;
|
|
343
|
+
/** Prefix of the player's accessible name: «Vídeo: {title}». */
|
|
344
|
+
player: string;
|
|
345
|
+
/** Visually hidden name of the duration. */
|
|
346
|
+
duration: string;
|
|
347
|
+
}
|
|
348
|
+
declare const DEFAULT_LESSON_PREVIEW_LABELS: LessonPreviewLabels;
|
|
349
|
+
interface LessonPreviewProps {
|
|
350
|
+
/** The preview as served (`AcademyLessonPreview`). */
|
|
351
|
+
lesson: AcademyLessonPreview;
|
|
352
|
+
labels?: Partial<LessonPreviewLabels>;
|
|
353
|
+
/** Level of the lesson title. Default `2`; use `1` on a dedicated preview page. */
|
|
354
|
+
headingLevel?: HeadingLevel;
|
|
355
|
+
/** `id` of the title (the article's `aria-labelledby`). */
|
|
356
|
+
headingId?: string;
|
|
357
|
+
/** Replaces the title's default typography (see the className rule in the README). */
|
|
358
|
+
headingClassName?: string;
|
|
359
|
+
/** Replaces the body's default colour. */
|
|
360
|
+
contentClassName?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
}
|
|
363
|
+
declare function LessonPreview({ lesson, labels: labelOverrides, headingLevel, headingId, headingClassName, contentClassName, className, }: LessonPreviewProps): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
322
365
|
/**
|
|
323
366
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
324
367
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -1302,4 +1345,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1302
1345
|
}
|
|
1303
1346
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1304
1347
|
|
|
1305
|
-
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, type MarkdownImageOptions, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfessionalFields, type ProfessionalFieldsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
|
1348
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfessionalFields, type ProfessionalFieldsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.js';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.js';
|
|
@@ -319,6 +319,49 @@ interface CourseDescriptionProps {
|
|
|
319
319
|
}
|
|
320
320
|
declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
* `LessonPreview` — the drop-in for a PUBLIC free-preview lesson (REB-1135),
|
|
324
|
+
* over `getLessonPreview()` (`@reblu/site-next/academy-server`), i.e.
|
|
325
|
+
* `GET /api/site/academy/courses/{slug}/lessons/{lessonSlug}`.
|
|
326
|
+
*
|
|
327
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`, no player
|
|
328
|
+
* dependency. The video is the provider's hosted player in an `<iframe>`
|
|
329
|
+
* (`video.embedUrl`, already carrying its short-lived token), so the SDK pulls
|
|
330
|
+
* in no video library and a SITE needs no player code. Only an `https:` URL is
|
|
331
|
+
* ever embedded.
|
|
332
|
+
*
|
|
333
|
+
* The body (`content`, Markdown) goes through the same pipeline as
|
|
334
|
+
* `CourseDescription` / `MarkdownRenderer` (`marked` → hast-util-sanitize):
|
|
335
|
+
* never raw HTML, no scripts, no `javascript:` links. Its own headings sit one
|
|
336
|
+
* level below the lesson title.
|
|
337
|
+
*
|
|
338
|
+
* CSP note for the SITE: the player needs `frame-src https://player.mux.com`.
|
|
339
|
+
*/
|
|
340
|
+
interface LessonPreviewLabels {
|
|
341
|
+
/** Badge above the title. */
|
|
342
|
+
badge: string;
|
|
343
|
+
/** Prefix of the player's accessible name: «Vídeo: {title}». */
|
|
344
|
+
player: string;
|
|
345
|
+
/** Visually hidden name of the duration. */
|
|
346
|
+
duration: string;
|
|
347
|
+
}
|
|
348
|
+
declare const DEFAULT_LESSON_PREVIEW_LABELS: LessonPreviewLabels;
|
|
349
|
+
interface LessonPreviewProps {
|
|
350
|
+
/** The preview as served (`AcademyLessonPreview`). */
|
|
351
|
+
lesson: AcademyLessonPreview;
|
|
352
|
+
labels?: Partial<LessonPreviewLabels>;
|
|
353
|
+
/** Level of the lesson title. Default `2`; use `1` on a dedicated preview page. */
|
|
354
|
+
headingLevel?: HeadingLevel;
|
|
355
|
+
/** `id` of the title (the article's `aria-labelledby`). */
|
|
356
|
+
headingId?: string;
|
|
357
|
+
/** Replaces the title's default typography (see the className rule in the README). */
|
|
358
|
+
headingClassName?: string;
|
|
359
|
+
/** Replaces the body's default colour. */
|
|
360
|
+
contentClassName?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
}
|
|
363
|
+
declare function LessonPreview({ lesson, labels: labelOverrides, headingLevel, headingId, headingClassName, contentClassName, className, }: LessonPreviewProps): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
322
365
|
/**
|
|
323
366
|
* `Treatment` — full treatment page organism over a `PageDetail` (a SERVICE-type
|
|
324
367
|
* page). Renders the hero band followed by the ordered content sections.
|
|
@@ -1302,4 +1345,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1302
1345
|
}
|
|
1303
1346
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1304
1347
|
|
|
1305
|
-
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, type MarkdownImageOptions, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfessionalFields, type ProfessionalFieldsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|
|
1348
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfessionalFields, type ProfessionalFieldsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
|