@photoroom/ui 0.1.849 → 0.1.850

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.
@@ -1,27 +1,53 @@
1
1
  import { type TileProps } from "../Tile";
2
2
  export type VideoPlayerTileProps = Readonly<{
3
- src: string;
3
+ /**
4
+ * Unset while the video is still on its way, e.g. fetched as a blob, or to release it off-screen:
5
+ * the poster shows meanwhile.
6
+ */
7
+ src?: string;
4
8
  posterSrc?: string;
5
9
  /** Names the player for assistive technologies; it is not shown. */
6
10
  label: string;
7
11
  playback?: "clickToPlay" | "autoplay";
8
- aspectRatio?: TileProps["aspectRatio"];
9
- /** Revealed on hover or focus, e.g. the selection. */
12
+ /**
13
+ * Plays, muted, while true and pauses while false, in place of the autoplay on mount, e.g. only the
14
+ * hovered tile of a grid. A tile with a poster then loads its video only once it first plays.
15
+ */
16
+ playing?: boolean;
17
+ /**
18
+ * Starts the autoplay muted, the only way browsers allow it before a click. False keeps the sound,
19
+ * e.g. for a video just opened by a click; the other players still fall silent.
20
+ */
21
+ autoplayMuted?: boolean;
22
+ /**
23
+ * Plays with sound while the pointer is over the tile and muted again once it leaves, e.g. in a
24
+ * grid. Keyboard focus keeps it muted, and so does a browser that refuses the sound.
25
+ */
26
+ soundOnHover?: boolean;
27
+ aspectRatio?: TileProps["aspectRatio"] | number;
28
+ /** Revealed on hover or keyboard focus, and kept while checked or selected, e.g. the selection. */
10
29
  leadingTop?: React.ReactNode;
11
- /** Revealed on hover or focus, e.g. Save and More. */
30
+ /** Revealed on hover or keyboard focus, and kept while selected or while a menu of it is open, e.g. Save and More. */
12
31
  trailingTop?: React.ReactNode;
13
32
  playLabel: string;
14
33
  pauseLabel: string;
15
34
  muteLabel: string;
16
35
  unmuteLabel: string;
17
36
  seekLabel: string;
18
- /** Shows the expand button. */
37
+ /** Shows the expand button, which pauses the tile before `onClick`. */
19
38
  expand?: Readonly<{
20
39
  label: string;
21
40
  onClick: () => void;
22
41
  }>;
42
+ /** Shows the minimize button next to the sound one, e.g. to close a full-size viewer. */
43
+ minimize?: Readonly<{
44
+ label: string;
45
+ onClick: () => void;
46
+ }>;
23
47
  /** Draws the Tile's selection border, e.g. while the selection in `leadingTop` is on. */
24
48
  isSelected?: boolean;
49
+ /** A click on the video itself, not on its controls, e.g. to open it bigger. */
50
+ onClick?: React.MouseEventHandler<HTMLVideoElement>;
25
51
  className?: string;
26
52
  }>;
27
53
  export declare const VideoPlayerTile: (props: VideoPlayerTileProps) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"VideoPlayerTile.d.ts","sourceRoot":"","sources":["../../../../src/components/content/VideoPlayer/VideoPlayerTile.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC;IACtC,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,sDAAsD;IACtD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IAC1D,yFAAyF;IACzF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB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