@nuskin/marketing-components 1.51.0 → 1.52.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/index.d.mts +94 -3
- package/dist/index.d.ts +94 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -201,11 +201,11 @@ declare const PLACEHOLDER_VALUES: {
|
|
|
201
201
|
readonly body: "Enter Body Text";
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
-
type PaddingScale = 'none' | 'small' | 'medium' | 'large';
|
|
204
|
+
type PaddingScale$1 = 'none' | 'small' | 'medium' | 'large';
|
|
205
205
|
type DividerStyle = 'solid' | 'dashed' | 'dotted' | 'none';
|
|
206
206
|
type DividerThickness = 'thin' | 'medium' | 'thick';
|
|
207
207
|
interface SpacingDividerProps {
|
|
208
|
-
vertical_padding?: PaddingScale;
|
|
208
|
+
vertical_padding?: PaddingScale$1;
|
|
209
209
|
divider_style?: DividerStyle;
|
|
210
210
|
divider_thickness?: DividerThickness;
|
|
211
211
|
divider_color?: string;
|
|
@@ -515,4 +515,95 @@ interface FaqProps {
|
|
|
515
515
|
|
|
516
516
|
declare const Faq: React$1.FC<FaqProps>;
|
|
517
517
|
|
|
518
|
-
|
|
518
|
+
type VideoKind = 'youtube' | 'vimeo' | 'embed';
|
|
519
|
+
type PaddingScale = 'none' | 'small' | 'medium' | 'large';
|
|
520
|
+
type Alignment = 'left' | 'center' | 'right';
|
|
521
|
+
/** Playback options for the video player. */
|
|
522
|
+
interface PlaybackOptions {
|
|
523
|
+
autoplay?: boolean;
|
|
524
|
+
/** When false, controls are hidden. Defaults to visible. */
|
|
525
|
+
controls?: boolean;
|
|
526
|
+
loop?: boolean;
|
|
527
|
+
}
|
|
528
|
+
/** Normalized, render-ready description of a video. */
|
|
529
|
+
interface VideoDescriptor extends PlaybackOptions {
|
|
530
|
+
/** 'youtube' | 'vimeo' render as a provider iframe; 'embed' renders a generic sandboxed iframe. */
|
|
531
|
+
kind: VideoKind;
|
|
532
|
+
/** Embed/iframe URL (providers & generic embeds) or direct media URL (file). */
|
|
533
|
+
src: string;
|
|
534
|
+
/** Optional human-readable title used for the iframe `title`. */
|
|
535
|
+
title?: string;
|
|
536
|
+
}
|
|
537
|
+
/** Raw values as supplied by the VideoPlayer component props. */
|
|
538
|
+
interface VideoPlayerProps {
|
|
539
|
+
/** Video source type: 'youtube', 'vimeo', or 'embed' (generic iframe). */
|
|
540
|
+
videoSource?: 'youtube' | 'vimeo' | 'embed' | string;
|
|
541
|
+
/** Provider video URL or bare ID, a generic embed URL, or a direct file URL. */
|
|
542
|
+
url?: string;
|
|
543
|
+
autoplay?: boolean;
|
|
544
|
+
controls?: boolean;
|
|
545
|
+
loop?: boolean;
|
|
546
|
+
/** Optional accessible title for the iframe. */
|
|
547
|
+
title?: string;
|
|
548
|
+
/** Horizontal alignment of the video within its container. */
|
|
549
|
+
alignment?: Alignment;
|
|
550
|
+
/** Vertical padding above and below the video. */
|
|
551
|
+
vertical_padding?: PaddingScale;
|
|
552
|
+
/** Horizontal padding to the left and right of the video. */
|
|
553
|
+
horizontal_padding?: PaddingScale;
|
|
554
|
+
/** Width of the video as a percentage of its container (0–100). */
|
|
555
|
+
width_percent?: number | string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Renders a sandboxed provider/embed iframe (YouTube, Vimeo, generic) or an
|
|
560
|
+
* HTML5 `<video>` for direct file URLs, given a normalized `VideoDescriptor`.
|
|
561
|
+
* This internal variant accepts a pre-built descriptor — useful when you already
|
|
562
|
+
* have one (e.g. from `buildVideoDescriptor`).
|
|
563
|
+
*/
|
|
564
|
+
declare function VideoPlayerFromDescriptor({ video }: {
|
|
565
|
+
readonly video: VideoDescriptor | null;
|
|
566
|
+
}): React$1.ReactElement;
|
|
567
|
+
/**
|
|
568
|
+
* Presentational video player component.
|
|
569
|
+
*
|
|
570
|
+
* Supports YouTube, Vimeo, generic embed iframes, and direct video file URLs.
|
|
571
|
+
* Pass `videoSource` and `url` to render a video; if either is missing a
|
|
572
|
+
* placeholder is shown instead.
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* // YouTube
|
|
576
|
+
* <VideoPlayer videoSource="youtube" url="https://www.youtube.com/watch?v=I0_951_MPE0" />
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* // Vimeo
|
|
580
|
+
* <VideoPlayer videoSource="vimeo" url="https://vimeo.com/22439234" />
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* // Direct file
|
|
584
|
+
* <VideoPlayer videoSource="url" url="https://example.com/video.mp4" controls loop />
|
|
585
|
+
*/
|
|
586
|
+
declare const VideoPlayer: React$1.FC<VideoPlayerProps>;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Only permit http/https URLs to prevent `javascript:` injection.
|
|
590
|
+
*/
|
|
591
|
+
declare function safeVideoSrc(url: unknown): string;
|
|
592
|
+
/**
|
|
593
|
+
* Extract the bare video ID from either a raw id or a full share/watch URL.
|
|
594
|
+
* The author may enter a YouTube/Vimeo URL or just the ID.
|
|
595
|
+
*/
|
|
596
|
+
declare function extractVideoId(source: string, raw: unknown): string;
|
|
597
|
+
/** Build a provider embed URL (YouTube/Vimeo), encoding playback options as query params. */
|
|
598
|
+
declare function buildEmbedUrl(source: string, raw: unknown, opts?: PlaybackOptions): string;
|
|
599
|
+
/**
|
|
600
|
+
* Build a render-ready VideoDescriptor from the VideoPlayer props.
|
|
601
|
+
* Returns null until enough has been entered to render something.
|
|
602
|
+
*
|
|
603
|
+
* Providers:
|
|
604
|
+
* - youtube / vimeo → provider embed iframe (options encoded in the URL).
|
|
605
|
+
* - embed → generic iframe using the entered URL as-is.
|
|
606
|
+
*/
|
|
607
|
+
declare function buildVideoDescriptor(videoSource: string | undefined, url: string | undefined, opts?: PlaybackOptions): VideoDescriptor | null;
|
|
608
|
+
|
|
609
|
+
export { type BannerAlignment, type BannerData, type BannerTextProps, Button, type Button$, type ButtonAlignment, type ButtonBlockProp, type ButtonProps, type ButtonSize, type ButtonType, type ButtonVariant, Buttons, type ButtonsBlock, type ButtonsBlock$, type ButtonsEntry, type BynderImageDataType, BynderMedia, type BynderMediaExtracted, type BynderMediaProps, type BynderMediaType, type CSEditTags$1 as CSEditTags, Carousel, type CarouselPreset, type CarouselProps, type CarouselRenderSlide, type ColorTheme, _default as ColumnControl, type ColumnControlProps, type ContentAlignment, ContentCard, type ContentCardProps, CsImage, CsText as CsTextComponent, DEFAULT_BANNER_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_ROTATION_INTERVAL, Faq, type FaqEditTags, type FaqItemData, type FaqItemEditTags, type FaqProps, type FaqSectionWidth, type GradientDepth$1 as GradientDepth, type GradientDirection, HeroBanner, type HeroBanner$, type HeroBannerMediaType, type HeroBannerProps, type IconPosition, type LinkTarget, MarketingBannerComponent as MarketingBanner, type MarketingBannerData, type MarketingBannerProps, type MediaType, PLACEHOLDER_VALUES, type PlaybackOptions, RichText as RichTextComponent, SpacingDivider, type SpacingDividerProps, TableRichText, type TextAlignment, type TextColor, type UseCarouselReturn, type VerticalAlignment, type VideoDescriptor, type VideoKind, VideoPlayer, VideoPlayerFromDescriptor, type VideoPlayerProps, buildEmbedUrl, buildVideoDescriptor, extractBynderMedia, extractVideoId, getMediaUrl, safeVideoSrc };
|
package/dist/index.d.ts
CHANGED
|
@@ -201,11 +201,11 @@ declare const PLACEHOLDER_VALUES: {
|
|
|
201
201
|
readonly body: "Enter Body Text";
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
-
type PaddingScale = 'none' | 'small' | 'medium' | 'large';
|
|
204
|
+
type PaddingScale$1 = 'none' | 'small' | 'medium' | 'large';
|
|
205
205
|
type DividerStyle = 'solid' | 'dashed' | 'dotted' | 'none';
|
|
206
206
|
type DividerThickness = 'thin' | 'medium' | 'thick';
|
|
207
207
|
interface SpacingDividerProps {
|
|
208
|
-
vertical_padding?: PaddingScale;
|
|
208
|
+
vertical_padding?: PaddingScale$1;
|
|
209
209
|
divider_style?: DividerStyle;
|
|
210
210
|
divider_thickness?: DividerThickness;
|
|
211
211
|
divider_color?: string;
|
|
@@ -515,4 +515,95 @@ interface FaqProps {
|
|
|
515
515
|
|
|
516
516
|
declare const Faq: React$1.FC<FaqProps>;
|
|
517
517
|
|
|
518
|
-
|
|
518
|
+
type VideoKind = 'youtube' | 'vimeo' | 'embed';
|
|
519
|
+
type PaddingScale = 'none' | 'small' | 'medium' | 'large';
|
|
520
|
+
type Alignment = 'left' | 'center' | 'right';
|
|
521
|
+
/** Playback options for the video player. */
|
|
522
|
+
interface PlaybackOptions {
|
|
523
|
+
autoplay?: boolean;
|
|
524
|
+
/** When false, controls are hidden. Defaults to visible. */
|
|
525
|
+
controls?: boolean;
|
|
526
|
+
loop?: boolean;
|
|
527
|
+
}
|
|
528
|
+
/** Normalized, render-ready description of a video. */
|
|
529
|
+
interface VideoDescriptor extends PlaybackOptions {
|
|
530
|
+
/** 'youtube' | 'vimeo' render as a provider iframe; 'embed' renders a generic sandboxed iframe. */
|
|
531
|
+
kind: VideoKind;
|
|
532
|
+
/** Embed/iframe URL (providers & generic embeds) or direct media URL (file). */
|
|
533
|
+
src: string;
|
|
534
|
+
/** Optional human-readable title used for the iframe `title`. */
|
|
535
|
+
title?: string;
|
|
536
|
+
}
|
|
537
|
+
/** Raw values as supplied by the VideoPlayer component props. */
|
|
538
|
+
interface VideoPlayerProps {
|
|
539
|
+
/** Video source type: 'youtube', 'vimeo', or 'embed' (generic iframe). */
|
|
540
|
+
videoSource?: 'youtube' | 'vimeo' | 'embed' | string;
|
|
541
|
+
/** Provider video URL or bare ID, a generic embed URL, or a direct file URL. */
|
|
542
|
+
url?: string;
|
|
543
|
+
autoplay?: boolean;
|
|
544
|
+
controls?: boolean;
|
|
545
|
+
loop?: boolean;
|
|
546
|
+
/** Optional accessible title for the iframe. */
|
|
547
|
+
title?: string;
|
|
548
|
+
/** Horizontal alignment of the video within its container. */
|
|
549
|
+
alignment?: Alignment;
|
|
550
|
+
/** Vertical padding above and below the video. */
|
|
551
|
+
vertical_padding?: PaddingScale;
|
|
552
|
+
/** Horizontal padding to the left and right of the video. */
|
|
553
|
+
horizontal_padding?: PaddingScale;
|
|
554
|
+
/** Width of the video as a percentage of its container (0–100). */
|
|
555
|
+
width_percent?: number | string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Renders a sandboxed provider/embed iframe (YouTube, Vimeo, generic) or an
|
|
560
|
+
* HTML5 `<video>` for direct file URLs, given a normalized `VideoDescriptor`.
|
|
561
|
+
* This internal variant accepts a pre-built descriptor — useful when you already
|
|
562
|
+
* have one (e.g. from `buildVideoDescriptor`).
|
|
563
|
+
*/
|
|
564
|
+
declare function VideoPlayerFromDescriptor({ video }: {
|
|
565
|
+
readonly video: VideoDescriptor | null;
|
|
566
|
+
}): React$1.ReactElement;
|
|
567
|
+
/**
|
|
568
|
+
* Presentational video player component.
|
|
569
|
+
*
|
|
570
|
+
* Supports YouTube, Vimeo, generic embed iframes, and direct video file URLs.
|
|
571
|
+
* Pass `videoSource` and `url` to render a video; if either is missing a
|
|
572
|
+
* placeholder is shown instead.
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* // YouTube
|
|
576
|
+
* <VideoPlayer videoSource="youtube" url="https://www.youtube.com/watch?v=I0_951_MPE0" />
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* // Vimeo
|
|
580
|
+
* <VideoPlayer videoSource="vimeo" url="https://vimeo.com/22439234" />
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* // Direct file
|
|
584
|
+
* <VideoPlayer videoSource="url" url="https://example.com/video.mp4" controls loop />
|
|
585
|
+
*/
|
|
586
|
+
declare const VideoPlayer: React$1.FC<VideoPlayerProps>;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Only permit http/https URLs to prevent `javascript:` injection.
|
|
590
|
+
*/
|
|
591
|
+
declare function safeVideoSrc(url: unknown): string;
|
|
592
|
+
/**
|
|
593
|
+
* Extract the bare video ID from either a raw id or a full share/watch URL.
|
|
594
|
+
* The author may enter a YouTube/Vimeo URL or just the ID.
|
|
595
|
+
*/
|
|
596
|
+
declare function extractVideoId(source: string, raw: unknown): string;
|
|
597
|
+
/** Build a provider embed URL (YouTube/Vimeo), encoding playback options as query params. */
|
|
598
|
+
declare function buildEmbedUrl(source: string, raw: unknown, opts?: PlaybackOptions): string;
|
|
599
|
+
/**
|
|
600
|
+
* Build a render-ready VideoDescriptor from the VideoPlayer props.
|
|
601
|
+
* Returns null until enough has been entered to render something.
|
|
602
|
+
*
|
|
603
|
+
* Providers:
|
|
604
|
+
* - youtube / vimeo → provider embed iframe (options encoded in the URL).
|
|
605
|
+
* - embed → generic iframe using the entered URL as-is.
|
|
606
|
+
*/
|
|
607
|
+
declare function buildVideoDescriptor(videoSource: string | undefined, url: string | undefined, opts?: PlaybackOptions): VideoDescriptor | null;
|
|
608
|
+
|
|
609
|
+
export { type BannerAlignment, type BannerData, type BannerTextProps, Button, type Button$, type ButtonAlignment, type ButtonBlockProp, type ButtonProps, type ButtonSize, type ButtonType, type ButtonVariant, Buttons, type ButtonsBlock, type ButtonsBlock$, type ButtonsEntry, type BynderImageDataType, BynderMedia, type BynderMediaExtracted, type BynderMediaProps, type BynderMediaType, type CSEditTags$1 as CSEditTags, Carousel, type CarouselPreset, type CarouselProps, type CarouselRenderSlide, type ColorTheme, _default as ColumnControl, type ColumnControlProps, type ContentAlignment, ContentCard, type ContentCardProps, CsImage, CsText as CsTextComponent, DEFAULT_BANNER_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_ROTATION_INTERVAL, Faq, type FaqEditTags, type FaqItemData, type FaqItemEditTags, type FaqProps, type FaqSectionWidth, type GradientDepth$1 as GradientDepth, type GradientDirection, HeroBanner, type HeroBanner$, type HeroBannerMediaType, type HeroBannerProps, type IconPosition, type LinkTarget, MarketingBannerComponent as MarketingBanner, type MarketingBannerData, type MarketingBannerProps, type MediaType, PLACEHOLDER_VALUES, type PlaybackOptions, RichText as RichTextComponent, SpacingDivider, type SpacingDividerProps, TableRichText, type TextAlignment, type TextColor, type UseCarouselReturn, type VerticalAlignment, type VideoDescriptor, type VideoKind, VideoPlayer, VideoPlayerFromDescriptor, type VideoPlayerProps, buildEmbedUrl, buildVideoDescriptor, extractBynderMedia, extractVideoId, getMediaUrl, safeVideoSrc };
|