@livo-tv/blocks 1.0.0 → 1.2.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.cts CHANGED
@@ -439,6 +439,165 @@ interface AvatarEditorDialogProps {
439
439
  }
440
440
  declare function AvatarEditorDialog({ value, onChange, onSave, displaySize, editorSize, outputSize, placeholder, editLabel, dialogTitle, acceptText, cancelText, savingText, savedText, successMessage, errorMessage, className, editorLabels, }: AvatarEditorDialogProps): React.JSX.Element;
441
441
 
442
+ type CurtainKind = "image" | "video";
443
+ interface CurtainStageProps {
444
+ kind: CurtainKind;
445
+ url: string;
446
+ alt?: string;
447
+ className?: string;
448
+ /** When true, video curtains show a static frame instead of looping. */
449
+ reducedMotion?: boolean;
450
+ }
451
+ /**
452
+ * Waiting-room backdrop: a still image or a muted looping video.
453
+ * Honors `prefers-reduced-motion` (or an explicit `reducedMotion` prop)
454
+ * by freezing video on the first frame.
455
+ */
456
+ declare function CurtainStage({ kind, url, alt, className, reducedMotion, }: CurtainStageProps): React.JSX.Element;
457
+
458
+ type CurtainPreviewProps = {
459
+ kind: CurtainKind | string;
460
+ url: string | null;
461
+ alt?: string;
462
+ className?: string;
463
+ /**
464
+ * When true (default), video curtains loop only while the tile is on
465
+ * screen. Off-screen and `prefers-reduced-motion` tiles stay on a
466
+ * static first frame so a large grid does not play every loop at once.
467
+ */
468
+ playWhenVisible?: boolean;
469
+ };
470
+ /**
471
+ * Thumbnail for a curtain asset: still image, or a muted looping video
472
+ * that plays only while visible (unless reduced motion is on).
473
+ */
474
+ declare function CurtainPreview({ kind, url, alt, className, playWhenVisible, }: CurtainPreviewProps): React.JSX.Element;
475
+
476
+ type CurtainPickerOwnerType = "organization" | "platform" | string;
477
+ type CurtainPickerItem = {
478
+ id: string;
479
+ title: string;
480
+ kind: CurtainKind | string;
481
+ publicUrl: string | null;
482
+ ownerType?: CurtainPickerOwnerType;
483
+ /** Consumer-computed default (org setting or platform `isDefault`). */
484
+ isDefault?: boolean;
485
+ };
486
+ type CurtainPickerLabels = {
487
+ select?: string;
488
+ none?: string;
489
+ noneDescription?: string;
490
+ defaultBadge?: string;
491
+ makeDefault?: string;
492
+ delete?: string;
493
+ image?: string;
494
+ video?: string;
495
+ organization?: string;
496
+ platform?: string;
497
+ groupOrganization?: string;
498
+ groupPlatform?: string;
499
+ groupOther?: string;
500
+ emptyTitle?: string;
501
+ emptyDescription?: string;
502
+ };
503
+ declare const DEFAULT_CURTAIN_PICKER_LABELS: Required<CurtainPickerLabels>;
504
+ type CurtainPickerProps = {
505
+ curtains: CurtainPickerItem[];
506
+ /** Selected curtain id. `null` / `""` means the optional None tile. */
507
+ value?: string | null;
508
+ onChange?: (id: string | null) => void;
509
+ allowNone?: boolean;
510
+ disabled?: boolean;
511
+ /** `compact` is for dialogs (tighter grid). */
512
+ variant?: "default" | "compact";
513
+ /** Split the grid into organization / platform / other sections. */
514
+ groupByOwner?: boolean;
515
+ onMakeDefault?: (item: CurtainPickerItem) => void;
516
+ onDelete?: (item: CurtainPickerItem) => void;
517
+ canMakeDefault?: (item: CurtainPickerItem) => boolean;
518
+ canDelete?: (item: CurtainPickerItem) => boolean;
519
+ labels?: CurtainPickerLabels;
520
+ emptyAction?: React.ReactNode;
521
+ className?: string;
522
+ /** Disable action buttons while a mutation is in flight. */
523
+ actionsPending?: boolean;
524
+ };
525
+ declare function CurtainPickerSkeleton({ count, variant, className, }: {
526
+ count?: number;
527
+ variant?: "default" | "compact";
528
+ className?: string;
529
+ }): React.JSX.Element;
530
+ /**
531
+ * Presentational curtain catalog: visual image / looping-video tiles,
532
+ * optional selection (including None), and optional manage actions.
533
+ * Consumers fetch, upload, and confirm deletes themselves.
534
+ */
535
+ declare function CurtainPicker({ curtains, value, onChange, allowNone, disabled, variant, groupByOwner, onMakeDefault, onDelete, canMakeDefault, canDelete, labels, emptyAction, className, actionsPending, }: CurtainPickerProps): React.JSX.Element;
536
+
537
+ interface WaitingRoomCurtain {
538
+ kind: CurtainKind;
539
+ url: string;
540
+ }
541
+ interface WaitingRoomProps {
542
+ title: string;
543
+ organizationName?: string | null;
544
+ organizationImage?: string | null;
545
+ startsAt?: number | null;
546
+ durationSeconds?: number | null;
547
+ curtain?: WaitingRoomCurtain | null;
548
+ nowMs?: number;
549
+ labels?: {
550
+ startsIn?: string;
551
+ started?: string;
552
+ duration?: (minutes: number) => string;
553
+ };
554
+ className?: string;
555
+ }
556
+ /**
557
+ * Public waiting-room chrome: curtain (or calm branded fallback), title,
558
+ * org avatar, and a countdown to `startsAt`.
559
+ */
560
+ declare function WaitingRoom({ title, organizationName, organizationImage, startsAt, durationSeconds, curtain, nowMs, labels, className, }: WaitingRoomProps): React.JSX.Element;
561
+
562
+ type CastFramework = {
563
+ CastContext: {
564
+ getInstance: () => {
565
+ setOptions: (options: {
566
+ receiverApplicationId: string;
567
+ autoJoinPolicy?: string;
568
+ }) => void;
569
+ requestSession: () => Promise<unknown>;
570
+ getCurrentSession: () => {
571
+ loadMedia: (request: unknown) => Promise<unknown>;
572
+ } | null;
573
+ };
574
+ };
575
+ };
576
+ type ChromeCast = {
577
+ media: {
578
+ DEFAULT_MEDIA_RECEIVER_APP_ID: string;
579
+ MediaInfo: new (url: string, contentType: string) => unknown;
580
+ LoadRequest: new (media: unknown) => unknown;
581
+ };
582
+ AutoJoinPolicy?: {
583
+ ORIGIN_SCOPED: string;
584
+ };
585
+ };
586
+ declare global {
587
+ interface Window {
588
+ cast?: {
589
+ framework?: CastFramework;
590
+ };
591
+ chrome?: {
592
+ cast?: ChromeCast;
593
+ };
594
+ __onGCastApiAvailable?: (available: boolean) => void;
595
+ }
596
+ }
597
+ declare function loadCastSender(): Promise<void>;
598
+ /** Cast an HLS master playlist to the default Chromecast media receiver. */
599
+ declare function castHlsUrl(hlsUrl: string): Promise<void>;
600
+
442
601
  /**
443
602
  * Playback error description, ported from the app's HLS player but stripped of
444
603
  * Sentry. `@livo/blocks` must stay reporting-agnostic: the player surfaces
@@ -540,6 +699,7 @@ interface VideoPlayerLabels {
540
699
  enterFullscreen?: string;
541
700
  exitFullscreen?: string;
542
701
  pictureInPicture?: string;
702
+ cast?: string;
543
703
  settings?: string;
544
704
  quality?: string;
545
705
  auto?: string;
@@ -687,4 +847,4 @@ declare function useMediaQuery(query: string): boolean;
687
847
 
688
848
  declare function cn(...inputs: ClassValue[]): string;
689
849
 
690
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FeedVideoPlayer, type FeedVideoPlayerProps, FieldMessage, type FieldMessageProps, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type QualityLevel, SafeImage, type SafeImageProps, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, shouldRetryLiveEdge404, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats };
850
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type CurtainKind, CurtainPicker, type CurtainPickerItem, type CurtainPickerLabels, type CurtainPickerOwnerType, type CurtainPickerProps, CurtainPickerSkeleton, CurtainPreview, type CurtainPreviewProps, CurtainStage, type CurtainStageProps, DEFAULT_CURTAIN_PICKER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FeedVideoPlayer, type FeedVideoPlayerProps, FieldMessage, type FieldMessageProps, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type QualityLevel, SafeImage, type SafeImageProps, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, WaitingRoom, type WaitingRoomCurtain, type WaitingRoomProps, castHlsUrl, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, loadCastSender, shouldRetryLiveEdge404, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats };
package/dist/index.d.ts CHANGED
@@ -439,6 +439,165 @@ interface AvatarEditorDialogProps {
439
439
  }
440
440
  declare function AvatarEditorDialog({ value, onChange, onSave, displaySize, editorSize, outputSize, placeholder, editLabel, dialogTitle, acceptText, cancelText, savingText, savedText, successMessage, errorMessage, className, editorLabels, }: AvatarEditorDialogProps): React.JSX.Element;
441
441
 
442
+ type CurtainKind = "image" | "video";
443
+ interface CurtainStageProps {
444
+ kind: CurtainKind;
445
+ url: string;
446
+ alt?: string;
447
+ className?: string;
448
+ /** When true, video curtains show a static frame instead of looping. */
449
+ reducedMotion?: boolean;
450
+ }
451
+ /**
452
+ * Waiting-room backdrop: a still image or a muted looping video.
453
+ * Honors `prefers-reduced-motion` (or an explicit `reducedMotion` prop)
454
+ * by freezing video on the first frame.
455
+ */
456
+ declare function CurtainStage({ kind, url, alt, className, reducedMotion, }: CurtainStageProps): React.JSX.Element;
457
+
458
+ type CurtainPreviewProps = {
459
+ kind: CurtainKind | string;
460
+ url: string | null;
461
+ alt?: string;
462
+ className?: string;
463
+ /**
464
+ * When true (default), video curtains loop only while the tile is on
465
+ * screen. Off-screen and `prefers-reduced-motion` tiles stay on a
466
+ * static first frame so a large grid does not play every loop at once.
467
+ */
468
+ playWhenVisible?: boolean;
469
+ };
470
+ /**
471
+ * Thumbnail for a curtain asset: still image, or a muted looping video
472
+ * that plays only while visible (unless reduced motion is on).
473
+ */
474
+ declare function CurtainPreview({ kind, url, alt, className, playWhenVisible, }: CurtainPreviewProps): React.JSX.Element;
475
+
476
+ type CurtainPickerOwnerType = "organization" | "platform" | string;
477
+ type CurtainPickerItem = {
478
+ id: string;
479
+ title: string;
480
+ kind: CurtainKind | string;
481
+ publicUrl: string | null;
482
+ ownerType?: CurtainPickerOwnerType;
483
+ /** Consumer-computed default (org setting or platform `isDefault`). */
484
+ isDefault?: boolean;
485
+ };
486
+ type CurtainPickerLabels = {
487
+ select?: string;
488
+ none?: string;
489
+ noneDescription?: string;
490
+ defaultBadge?: string;
491
+ makeDefault?: string;
492
+ delete?: string;
493
+ image?: string;
494
+ video?: string;
495
+ organization?: string;
496
+ platform?: string;
497
+ groupOrganization?: string;
498
+ groupPlatform?: string;
499
+ groupOther?: string;
500
+ emptyTitle?: string;
501
+ emptyDescription?: string;
502
+ };
503
+ declare const DEFAULT_CURTAIN_PICKER_LABELS: Required<CurtainPickerLabels>;
504
+ type CurtainPickerProps = {
505
+ curtains: CurtainPickerItem[];
506
+ /** Selected curtain id. `null` / `""` means the optional None tile. */
507
+ value?: string | null;
508
+ onChange?: (id: string | null) => void;
509
+ allowNone?: boolean;
510
+ disabled?: boolean;
511
+ /** `compact` is for dialogs (tighter grid). */
512
+ variant?: "default" | "compact";
513
+ /** Split the grid into organization / platform / other sections. */
514
+ groupByOwner?: boolean;
515
+ onMakeDefault?: (item: CurtainPickerItem) => void;
516
+ onDelete?: (item: CurtainPickerItem) => void;
517
+ canMakeDefault?: (item: CurtainPickerItem) => boolean;
518
+ canDelete?: (item: CurtainPickerItem) => boolean;
519
+ labels?: CurtainPickerLabels;
520
+ emptyAction?: React.ReactNode;
521
+ className?: string;
522
+ /** Disable action buttons while a mutation is in flight. */
523
+ actionsPending?: boolean;
524
+ };
525
+ declare function CurtainPickerSkeleton({ count, variant, className, }: {
526
+ count?: number;
527
+ variant?: "default" | "compact";
528
+ className?: string;
529
+ }): React.JSX.Element;
530
+ /**
531
+ * Presentational curtain catalog: visual image / looping-video tiles,
532
+ * optional selection (including None), and optional manage actions.
533
+ * Consumers fetch, upload, and confirm deletes themselves.
534
+ */
535
+ declare function CurtainPicker({ curtains, value, onChange, allowNone, disabled, variant, groupByOwner, onMakeDefault, onDelete, canMakeDefault, canDelete, labels, emptyAction, className, actionsPending, }: CurtainPickerProps): React.JSX.Element;
536
+
537
+ interface WaitingRoomCurtain {
538
+ kind: CurtainKind;
539
+ url: string;
540
+ }
541
+ interface WaitingRoomProps {
542
+ title: string;
543
+ organizationName?: string | null;
544
+ organizationImage?: string | null;
545
+ startsAt?: number | null;
546
+ durationSeconds?: number | null;
547
+ curtain?: WaitingRoomCurtain | null;
548
+ nowMs?: number;
549
+ labels?: {
550
+ startsIn?: string;
551
+ started?: string;
552
+ duration?: (minutes: number) => string;
553
+ };
554
+ className?: string;
555
+ }
556
+ /**
557
+ * Public waiting-room chrome: curtain (or calm branded fallback), title,
558
+ * org avatar, and a countdown to `startsAt`.
559
+ */
560
+ declare function WaitingRoom({ title, organizationName, organizationImage, startsAt, durationSeconds, curtain, nowMs, labels, className, }: WaitingRoomProps): React.JSX.Element;
561
+
562
+ type CastFramework = {
563
+ CastContext: {
564
+ getInstance: () => {
565
+ setOptions: (options: {
566
+ receiverApplicationId: string;
567
+ autoJoinPolicy?: string;
568
+ }) => void;
569
+ requestSession: () => Promise<unknown>;
570
+ getCurrentSession: () => {
571
+ loadMedia: (request: unknown) => Promise<unknown>;
572
+ } | null;
573
+ };
574
+ };
575
+ };
576
+ type ChromeCast = {
577
+ media: {
578
+ DEFAULT_MEDIA_RECEIVER_APP_ID: string;
579
+ MediaInfo: new (url: string, contentType: string) => unknown;
580
+ LoadRequest: new (media: unknown) => unknown;
581
+ };
582
+ AutoJoinPolicy?: {
583
+ ORIGIN_SCOPED: string;
584
+ };
585
+ };
586
+ declare global {
587
+ interface Window {
588
+ cast?: {
589
+ framework?: CastFramework;
590
+ };
591
+ chrome?: {
592
+ cast?: ChromeCast;
593
+ };
594
+ __onGCastApiAvailable?: (available: boolean) => void;
595
+ }
596
+ }
597
+ declare function loadCastSender(): Promise<void>;
598
+ /** Cast an HLS master playlist to the default Chromecast media receiver. */
599
+ declare function castHlsUrl(hlsUrl: string): Promise<void>;
600
+
442
601
  /**
443
602
  * Playback error description, ported from the app's HLS player but stripped of
444
603
  * Sentry. `@livo/blocks` must stay reporting-agnostic: the player surfaces
@@ -540,6 +699,7 @@ interface VideoPlayerLabels {
540
699
  enterFullscreen?: string;
541
700
  exitFullscreen?: string;
542
701
  pictureInPicture?: string;
702
+ cast?: string;
543
703
  settings?: string;
544
704
  quality?: string;
545
705
  auto?: string;
@@ -687,4 +847,4 @@ declare function useMediaQuery(query: string): boolean;
687
847
 
688
848
  declare function cn(...inputs: ClassValue[]): string;
689
849
 
690
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FeedVideoPlayer, type FeedVideoPlayerProps, FieldMessage, type FieldMessageProps, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type QualityLevel, SafeImage, type SafeImageProps, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, shouldRetryLiveEdge404, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats };
850
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type CurtainKind, CurtainPicker, type CurtainPickerItem, type CurtainPickerLabels, type CurtainPickerOwnerType, type CurtainPickerProps, CurtainPickerSkeleton, CurtainPreview, type CurtainPreviewProps, CurtainStage, type CurtainStageProps, DEFAULT_CURTAIN_PICKER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FeedVideoPlayer, type FeedVideoPlayerProps, FieldMessage, type FieldMessageProps, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type QualityLevel, SafeImage, type SafeImageProps, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, WaitingRoom, type WaitingRoomCurtain, type WaitingRoomProps, castHlsUrl, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, loadCastSender, shouldRetryLiveEdge404, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats };