@retoo/scena 0.0.2 → 0.1.1

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![bundle size](https://img.shields.io/badge/gzipped-~30KB-blue)](https://use-retoo.github.io/scena/distribution/bundle-size)
5
5
  [![license](https://img.shields.io/badge/license-PolyForm%20Shield%201.0.0-blue)](./LICENSE.md)
6
6
 
7
- Embeddable video widget for any website. Framework-agnostic, SSR-safe, ~26KB gzipped.
7
+ Embeddable video widget for any website. Framework-agnostic, SSR-safe, ~30KB gzipped.
8
8
 
9
9
  **[Documentation](https://use-retoo.github.io/scena)**
10
10
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { default as Scena } from './app/entrypoint/ui/Scena.svelte';
2
-
3
1
  /** Event names emitted by the scena widget event bus. */
4
2
  declare enum ScenaEvent {
5
3
  /** Fired when the scena instance is destroyed. */
@@ -294,6 +292,10 @@ interface ScenaCloseButtonComponentStyles {
294
292
  button: ComponentStyles;
295
293
  cross: ComponentStyles;
296
294
  }
295
+ /** Custom HTML override for the close button. */
296
+ interface ScenaCloseButtonComponentHtml {
297
+ button: string;
298
+ }
297
299
  /** Configuration props for the close button widget. */
298
300
  interface ScenaCloseButtonProps {
299
301
  id: string;
@@ -302,6 +304,7 @@ interface ScenaCloseButtonProps {
302
304
  aria: Partial<ComponentAriaProps>;
303
305
  customClasses: Partial<ScenaCloseButtonComponentClasses>;
304
306
  customStyles: Partial<ScenaCloseButtonComponentStyles>;
307
+ customHtml: Partial<ScenaCloseButtonComponentHtml>;
305
308
  onClick: (event: Event) => void;
306
309
  }
307
310
  /** DOM elements exposed by the close button component. */
@@ -330,6 +333,10 @@ interface ScenaCtaButtonComponentStyles {
330
333
  root: ComponentStyles;
331
334
  button: ComponentStyles;
332
335
  }
336
+ /** Custom HTML override for the CTA button. */
337
+ interface ScenaCtaButtonComponentHtml {
338
+ button: string;
339
+ }
333
340
  /** Adaptive display settings for the CTA button across screen sizes. */
334
341
  interface ScenaCtaButtonAdaptive {
335
342
  sizes: ComponentSize[];
@@ -345,6 +352,7 @@ interface ScenaCtaButtonProps {
345
352
  aria: Partial<ComponentAriaProps>;
346
353
  customClasses: Partial<ScenaCtaButtonComponentClasses>;
347
354
  customStyles: Partial<ScenaCtaButtonComponentStyles>;
355
+ customHtml: Partial<ScenaCtaButtonComponentHtml>;
348
356
  onClick: (event: Event) => void;
349
357
  }
350
358
  /** DOM elements exposed by the CTA button component. */
@@ -499,7 +507,7 @@ interface ScenaVideoSnippets {
499
507
  /** Options for creating the video controller. */
500
508
  interface UseVideoControllerOptions {
501
509
  /** Getter that returns the underlying `<video>` DOM element. */
502
- getVideoElement: () => HTMLVideoElement;
510
+ getVideoElement: () => HTMLVideoElement | null;
503
511
  /** Event emitter to broadcast video lifecycle events. */
504
512
  eventEmitter: ScenaEventEmitter;
505
513
  }
@@ -508,7 +516,7 @@ type UseVideoControllerReturns = ScenaVideoData & ScenaVideoMethods & ScenaVideo
508
516
  /** DOM elements exposed by the video widget. */
509
517
  interface ScenaVideoElements {
510
518
  root: HTMLDivElement | null;
511
- video: HTMLVideoElement;
519
+ video: HTMLVideoElement | null;
512
520
  }
513
521
  /** Component ref for the video widget. */
514
522
  interface ScenaVideoRef {
@@ -564,6 +572,11 @@ interface ScenaVideoControlsComponentStyles {
564
572
  play: ComponentStyles;
565
573
  pause: ComponentStyles;
566
574
  }
575
+ /** Custom HTML overrides for the video play/pause controls. */
576
+ interface ScenaVideoControlsComponentHtml {
577
+ play: string;
578
+ pause: string;
579
+ }
567
580
  /** Per-button ARIA overrides for video controls. */
568
581
  interface ScenaVideoControlsComponentAria {
569
582
  play: Partial<ComponentAriaProps>;
@@ -576,6 +589,7 @@ interface ScenaVideoControlsProps {
576
589
  aria: Partial<ScenaVideoControlsComponentAria>;
577
590
  customClasses: Partial<ScenaVideoControlsComponentClasses>;
578
591
  customStyles: Partial<ScenaVideoControlsComponentStyles>;
592
+ customHtml: Partial<ScenaVideoControlsComponentHtml>;
579
593
  }
580
594
  /** DOM elements exposed by the video controls component. */
581
595
  interface ScenaVideoControlsElements {
@@ -620,12 +634,17 @@ interface ScenaVideoLoaderComponentStyles {
620
634
  root: ComponentStyles;
621
635
  loader: ComponentStyles;
622
636
  }
637
+ /** Custom HTML override for the video loader. */
638
+ interface ScenaVideoLoaderComponentHtml {
639
+ loader: string;
640
+ }
623
641
  /** Configuration props for the video buffering/loading indicator. */
624
642
  interface ScenaVideoLoaderProps {
625
643
  id: string;
626
644
  size: ComponentSize;
627
645
  customClasses: Partial<ScenaVideoLoaderComponentClasses>;
628
646
  customStyles: Partial<ScenaVideoLoaderComponentStyles>;
647
+ customHtml: Partial<ScenaVideoLoaderComponentHtml>;
629
648
  }
630
649
  /** DOM elements exposed by the video loader component. */
631
650
  interface ScenaVideoLoaderElements {
@@ -737,8 +756,8 @@ interface UseProgressLineReturn {
737
756
  /** Props accepted by the line progress hook. */
738
757
  interface UseProgressLineProps {
739
758
  getRootElement: () => HTMLElement;
740
- getSize: () => ComponentSize;
741
759
  getCustomThickness: () => ScenaProgressComponentThickness;
760
+ getSize: () => ComponentSize;
742
761
  getProgress: () => number;
743
762
  }
744
763
  /** Seek event callbacks used internally by the line progress hook. */
@@ -749,9 +768,9 @@ interface UseProgressLineEvents {
749
768
  }
750
769
  /** Props accepted by the circle progress hook. */
751
770
  interface UseProgressCircleProps {
752
- getRootElement: () => SVGSVGElement;
753
- getSize: () => ComponentSize;
771
+ getRootElement: () => SVGSVGElement | null;
754
772
  getCustomThickness: () => ScenaProgressComponentThickness;
773
+ getSize: () => ComponentSize;
755
774
  getProgress: () => number;
756
775
  getBuffer: () => number;
757
776
  }
@@ -859,6 +878,11 @@ interface ScenaVideoVolumeComponentStyles {
859
878
  mute: ComponentStyles;
860
879
  unmute: ComponentStyles;
861
880
  }
881
+ /** Custom HTML overrides for the volume mute/unmute controls. */
882
+ interface ScenaVideoVolumeComponentHtml {
883
+ mute: string;
884
+ unmute: string;
885
+ }
862
886
  /** Per-button ARIA overrides for volume controls. */
863
887
  interface ScenaVideoVolumeComponentAria {
864
888
  mute: Partial<ComponentAriaProps>;
@@ -872,6 +896,7 @@ interface ScenaVideoVolumeProps {
872
896
  aria: Partial<ScenaVideoVolumeComponentAria>;
873
897
  customClasses: Partial<ScenaVideoVolumeComponentClasses>;
874
898
  customStyles: Partial<ScenaVideoVolumeComponentStyles>;
899
+ customHtml: Partial<ScenaVideoVolumeComponentHtml>;
875
900
  }
876
901
  /** DOM elements exposed by the volume control component. */
877
902
  interface ScenaVideoVolumeElements {
@@ -1156,22 +1181,11 @@ declare function useScenaVisibility(config: UseScenaConfigReturns, eventEmitter:
1156
1181
  */
1157
1182
  declare function useScenaResponsive(config: UseScenaConfigReturns, configOverrides: UseScenaOverridesReturns): UseScenaResponsiveReturns;
1158
1183
 
1159
- /**
1160
- * Returns the custom element constructor if it has already been registered.
1161
- *
1162
- * @returns The registered `CustomElementConstructor`, or `undefined` if not yet defined.
1163
- */
1164
- declare function getScenaElement(): CustomElementConstructor | undefined;
1165
- /**
1166
- * Registers the `<scena-video-widget>` custom element in the browser.
1167
- *
1168
- * Safe to call multiple times — skips registration if the element is already defined.
1169
- */
1170
- declare function defineScenaElement(): void;
1171
-
1172
1184
  /** The HTML tag name used for the scena custom element. */
1173
1185
  type ScenaElementTag = 'scena-video-widget';
1174
1186
 
1187
+ declare const TAG_NAME: ScenaElementTag;
1188
+
1175
1189
  /**
1176
1190
  * SSR-safe `HTMLElement` constructor.
1177
1191
  *
@@ -1182,6 +1196,19 @@ type ScenaElementTag = 'scena-video-widget';
1182
1196
  */
1183
1197
  declare const SAFE_HTML_ELEMENT: typeof HTMLElement;
1184
1198
 
1199
+ /**
1200
+ * Returns the custom element constructor if it has already been registered.
1201
+ *
1202
+ * @returns The registered `CustomElementConstructor`, or `undefined` if not yet defined.
1203
+ */
1204
+ declare function getScenaElement(): CustomElementConstructor | undefined;
1205
+ /**
1206
+ * Registers the `<scena-video-widget>` custom element in the browser.
1207
+ *
1208
+ * Safe to call multiple times — skips registration if the element is already defined.
1209
+ */
1210
+ declare function defineScenaElement(): void;
1211
+
1185
1212
  /**
1186
1213
  * Custom HTML element that wraps the scena video widget.
1187
1214
  *
@@ -1252,5 +1279,5 @@ interface ScenaContext {
1252
1279
  declare const getScenaContext: () => ScenaContext;
1253
1280
  declare const setScenaContext: (context: ScenaContext) => ScenaContext;
1254
1281
 
1255
- export { ComponentAriaHaspopup, ComponentAriaPressed, ComponentPlacement, ComponentPosition, ComponentShape, ComponentSize, OverrideLayer, ScenaButtonAriaHaspopup, ScenaButtonAriaPressed, ScenaButtonShape, ScenaButtonType, ScenaButtonVariant, ScenaCtaButtonPlacement, ScenaElement, ScenaEvent, ScenaVideoCrossOrigin, ScenaVideoPreload, ScenaVideoProgressVariant, ScenaVideoState, defineScenaElement, getScenaContext, getScenaElement, getScenaVideoContext, scenaProgressCircleThicknessMap, scenaProgressLineThicknessMap, setScenaContext, setScenaVideoContext, useEventEmitter, useProgressCircle, useProgressLine, useScena, useScenaConfig, useScenaOverrides, useScenaPreview, useScenaResponsive, useScenaVisibility, useVideoController };
1256
- export type { ComponentAriaProps, ComponentClasses, ComponentRef, ComponentSnippet, ComponentSnippetReturn, ComponentStyles, ScenaApi, ScenaButtonComponentClasses, ScenaButtonComponentStyles, ScenaButtonElements, ScenaButtonEvents, ScenaButtonProps, ScenaButtonSnippets, ScenaCloseButtonComponentClasses, ScenaCloseButtonComponentStyles, ScenaCloseButtonElements, ScenaCloseButtonProps, ScenaCloseButtonRef, ScenaComponents, ScenaConfig, ScenaConfigFeatures, ScenaConfigOverrides, ScenaContainerCustomClasses, ScenaContainerCustomStyles, ScenaContainerElements, ScenaContainerProps, ScenaContainerRef, ScenaContainerSnippets, ScenaContext, ScenaCtaButtonAdaptive, ScenaCtaButtonComponentClasses, ScenaCtaButtonComponentStyles, ScenaCtaButtonElements, ScenaCtaButtonProps, ScenaCtaButtonRef, ScenaElementTag, ScenaEventEmitter, ScenaEventHandler, ScenaEventMap, ScenaFeatures, ScenaIconCustomClasses, ScenaIconCustomStyles, ScenaIconElements, ScenaIconProps, ScenaIconSnippets, ScenaInstance, ScenaLoaderCustomClasses, ScenaLoaderCustomStyles, ScenaLoaderElements, ScenaLoaderProps, ScenaOverrides, ScenaPreviewApi, ScenaPreviewConfig, ScenaProgressCircleComponentClasses, ScenaProgressCircleComponentStyles, ScenaProgressCircleElements, ScenaProgressCircleEvents, ScenaProgressCircleProps, ScenaProgressComponentThickness, ScenaProgressLineComponentClasses, ScenaProgressLineComponentStyles, ScenaProgressLineElements, ScenaProgressLineEvents, ScenaProgressLineProps, ScenaProgressThickness, ScenaProps, ScenaRef, ScenaResponsiveApi, ScenaResponsiveConfig, ScenaTarget, ScenaVideoCallbacks, ScenaVideoComponentClasses, ScenaVideoComponentStyles, ScenaVideoContainerCustomClasses, ScenaVideoContainerCustomStyles, ScenaVideoContainerElements, ScenaVideoContainerProps, ScenaVideoContainerRef, ScenaVideoContainerSnippets, ScenaVideoContext, ScenaVideoControlsComponentAria, ScenaVideoControlsComponentClasses, ScenaVideoControlsComponentStyles, ScenaVideoControlsElements, ScenaVideoControlsProps, ScenaVideoControlsRef, ScenaVideoData, ScenaVideoElements, ScenaVideoEventOptions, ScenaVideoEventOptionsWithError, ScenaVideoEventOptionsWithEvent, ScenaVideoLoaderComponentClasses, ScenaVideoLoaderComponentStyles, ScenaVideoLoaderElements, ScenaVideoLoaderProps, ScenaVideoLoaderRef, ScenaVideoMethods, ScenaVideoProgressComponentClasses, ScenaVideoProgressComponentStyles, ScenaVideoProgressComponentThickness, ScenaVideoProgressElements, ScenaVideoProgressProps, ScenaVideoProgressRef, ScenaVideoProgressThickness, ScenaVideoProgressThicknessMap, ScenaVideoProps, ScenaVideoRef, ScenaVideoSnippets, ScenaVideoVolumeComponentAria, ScenaVideoVolumeComponentClasses, ScenaVideoVolumeComponentStyles, ScenaVideoVolumeElements, ScenaVideoVolumeProps, ScenaVideoVolumeRef, ScenaVisibilityApi, ScenaVisibilityConfig, UseProgressCircleEvents, UseProgressCircleProps, UseProgressCircleReturn, UseProgressCircleReturnEvents, UseProgressLineEvents, UseProgressLineProps, UseProgressLineReturn, UseProgressLineReturnEvents, UseScenaConfigReturns, UseScenaOverridesReturns, UseScenaPreviewOptions, UseScenaPreviewReturns, UseScenaResponsiveReturns, UseScenaReturns, UseScenaVisibilityReturns, UseVideoControllerOptions, UseVideoControllerReturns };
1282
+ export { ComponentAriaHaspopup, ComponentAriaPressed, ComponentPlacement, ComponentPosition, ComponentShape, ComponentSize, OverrideLayer, SAFE_HTML_ELEMENT, ScenaButtonAriaHaspopup, ScenaButtonAriaPressed, ScenaButtonShape, ScenaButtonType, ScenaButtonVariant, ScenaCtaButtonPlacement, ScenaElement, ScenaEvent, ScenaVideoCrossOrigin, ScenaVideoPreload, ScenaVideoProgressVariant, ScenaVideoState, TAG_NAME, defineScenaElement, getScenaContext, getScenaElement, getScenaVideoContext, scenaProgressCircleThicknessMap, scenaProgressLineThicknessMap, setScenaContext, setScenaVideoContext, useEventEmitter, useProgressCircle, useProgressLine, useScena, useScenaConfig, useScenaOverrides, useScenaPreview, useScenaResponsive, useScenaVisibility, useVideoController };
1283
+ export type { ComponentAriaProps, ComponentClasses, ComponentRef, ComponentSnippet, ComponentSnippetReturn, ComponentStyles, ScenaApi, ScenaButtonComponentClasses, ScenaButtonComponentStyles, ScenaButtonElements, ScenaButtonEvents, ScenaButtonProps, ScenaButtonSnippets, ScenaCloseButtonComponentClasses, ScenaCloseButtonComponentHtml, ScenaCloseButtonComponentStyles, ScenaCloseButtonElements, ScenaCloseButtonProps, ScenaCloseButtonRef, ScenaComponents, ScenaConfig, ScenaConfigFeatures, ScenaConfigOverrides, ScenaContainerCustomClasses, ScenaContainerCustomStyles, ScenaContainerElements, ScenaContainerProps, ScenaContainerRef, ScenaContainerSnippets, ScenaContext, ScenaCtaButtonAdaptive, ScenaCtaButtonComponentClasses, ScenaCtaButtonComponentHtml, ScenaCtaButtonComponentStyles, ScenaCtaButtonElements, ScenaCtaButtonProps, ScenaCtaButtonRef, ScenaElementTag, ScenaEventEmitter, ScenaEventHandler, ScenaEventMap, ScenaFeatures, ScenaIconCustomClasses, ScenaIconCustomStyles, ScenaIconElements, ScenaIconProps, ScenaIconSnippets, ScenaInstance, ScenaLoaderCustomClasses, ScenaLoaderCustomStyles, ScenaLoaderElements, ScenaLoaderProps, ScenaOverrides, ScenaPreviewApi, ScenaPreviewBehavior, ScenaPreviewConfig, ScenaProgressCircleComponentClasses, ScenaProgressCircleComponentStyles, ScenaProgressCircleElements, ScenaProgressCircleEvents, ScenaProgressCircleProps, ScenaProgressComponentThickness, ScenaProgressLineComponentClasses, ScenaProgressLineComponentStyles, ScenaProgressLineElements, ScenaProgressLineEvents, ScenaProgressLineProps, ScenaProgressThickness, ScenaProps, ScenaRef, ScenaResponsiveApi, ScenaResponsiveConfig, ScenaTarget, ScenaVideoCallbacks, ScenaVideoComponentClasses, ScenaVideoComponentStyles, ScenaVideoContainerCustomClasses, ScenaVideoContainerCustomStyles, ScenaVideoContainerElements, ScenaVideoContainerProps, ScenaVideoContainerRef, ScenaVideoContainerSnippets, ScenaVideoContext, ScenaVideoControlsComponentAria, ScenaVideoControlsComponentClasses, ScenaVideoControlsComponentHtml, ScenaVideoControlsComponentStyles, ScenaVideoControlsElements, ScenaVideoControlsProps, ScenaVideoControlsRef, ScenaVideoData, ScenaVideoElements, ScenaVideoEventOptions, ScenaVideoEventOptionsWithError, ScenaVideoEventOptionsWithEvent, ScenaVideoLoaderComponentClasses, ScenaVideoLoaderComponentHtml, ScenaVideoLoaderComponentStyles, ScenaVideoLoaderElements, ScenaVideoLoaderProps, ScenaVideoLoaderRef, ScenaVideoMethods, ScenaVideoProgressComponentClasses, ScenaVideoProgressComponentStyles, ScenaVideoProgressComponentThickness, ScenaVideoProgressElements, ScenaVideoProgressProps, ScenaVideoProgressRef, ScenaVideoProgressThickness, ScenaVideoProgressThicknessMap, ScenaVideoProps, ScenaVideoRef, ScenaVideoSnippets, ScenaVideoVolumeComponentAria, ScenaVideoVolumeComponentClasses, ScenaVideoVolumeComponentHtml, ScenaVideoVolumeComponentStyles, ScenaVideoVolumeElements, ScenaVideoVolumeProps, ScenaVideoVolumeRef, ScenaVisibilityApi, ScenaVisibilityConfig, UseProgressCircleEvents, UseProgressCircleProps, UseProgressCircleReturn, UseProgressCircleReturnEvents, UseProgressLineEvents, UseProgressLineProps, UseProgressLineReturn, UseProgressLineReturnEvents, UseScenaConfigReturns, UseScenaOverridesReturns, UseScenaPreviewOptions, UseScenaPreviewReturns, UseScenaResponsiveReturns, UseScenaReturns, UseScenaVisibilityReturns, UseVideoControllerOptions, UseVideoControllerReturns };