@wix/editor-react-components 1.2791.0 → 1.2793.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.
@@ -11,7 +11,6 @@ function SiteLogo(props) {
11
11
  const internalSvgId = React__default.useMemo(() => getUniqueId("svg", "-"), []);
12
12
  const { mediaType, svgId, image, link, a11y, className, id, ...otherProps } = props;
13
13
  const elementId = id ?? internalSvgId;
14
- const alt = !(a11y == null ? void 0 : a11y.ariaHidden) ? (a11y == null ? void 0 : a11y.ariaLabel) || "" : "";
15
14
  if (mediaType === "image") {
16
15
  return /* @__PURE__ */ jsx(
17
16
  Image3,
@@ -20,11 +19,11 @@ function SiteLogo(props) {
20
19
  className: clsx(semanticClassNames.root, className),
21
20
  link,
22
21
  displayMode: "fit",
23
- a11y: (a11y == null ? void 0 : a11y.ariaHidden) ? { role: "presentation" } : void 0,
24
- image: { ...image, alt }
22
+ image: image && { ...image, alt: image.alt || void 0 }
25
23
  }
26
24
  );
27
25
  }
26
+ const alt = !(a11y == null ? void 0 : a11y.ariaHidden) ? (a11y == null ? void 0 : a11y.ariaLabel) || "" : "";
28
27
  const svg = svgId ?? {
29
28
  uri: "empty.svg",
30
29
  viewBox: "0 0 200 200",
@@ -1,4 +1,8 @@
1
+ import { DATA } from '@wix/component-protocol/schema';
1
2
  import { VideoUploadProps } from '../VideoUpload/VideoUpload.types';
3
+ type TransparentVideoBaseProps = Omit<VideoUploadProps, 'a11y'> & {
4
+ a11y?: Partial<typeof DATA.A11Y_ATTRIBUTES>;
5
+ };
2
6
  export declare enum VideoStartType {
3
7
  auto = "auto",
4
8
  click = "click",
@@ -20,13 +24,13 @@ export type TransparentVideoFilterEffect = {
20
24
  saturation?: number;
21
25
  invert?: boolean;
22
26
  };
23
- export interface TransparentVideoProps extends VideoUploadProps {
27
+ export interface TransparentVideoProps extends TransparentVideoBaseProps {
24
28
  hideCanvas: boolean;
25
29
  videoStartType: VideoStartType;
26
30
  videoEndType: VideoEndType;
27
31
  filterEffect?: TransparentVideoFilterEffect;
28
32
  }
29
- export interface TransparentVideoBuilderProps extends TransparentVideoFilterEffect, VideoUploadProps {
33
+ export interface TransparentVideoBuilderProps extends TransparentVideoFilterEffect, TransparentVideoBaseProps {
30
34
  hideCanvas: boolean;
31
35
  videoStartType: VideoStartType;
32
36
  videoEndType: VideoEndType;
@@ -47,3 +51,4 @@ export declare enum FilterEffectType {
47
51
  grayscale = "grayscale",
48
52
  tvHue = "tvHue"
49
53
  }
54
+ export {};
@@ -3280,7 +3280,6 @@ function tvControllerFactory({
3280
3280
  };
3281
3281
  return controller;
3282
3282
  }
3283
- const isActivationKey = (event) => event.key === " " || event.key === "Enter";
3284
3283
  function useTransparentVideo(props) {
3285
3284
  const {
3286
3285
  a11y,
@@ -3428,16 +3427,6 @@ function useTransparentVideo(props) {
3428
3427
  (_b = videoRef.current) == null ? void 0 : _b.play();
3429
3428
  }
3430
3429
  }, [playingState, isPlaying, shouldReplay]);
3431
- const onKeyDownHandler = useCallback(
3432
- (event) => {
3433
- if (isActivationKey(event)) {
3434
- event.stopPropagation();
3435
- event.preventDefault();
3436
- onClickHandler();
3437
- }
3438
- },
3439
- [onClickHandler]
3440
- );
3441
3430
  const onMouseEnterHandler = useCallback(() => {
3442
3431
  var _a;
3443
3432
  if (playingState === VideoPlayingState.ended && !shouldReplay) {
@@ -3460,16 +3449,6 @@ function useTransparentVideo(props) {
3460
3449
  },
3461
3450
  []
3462
3451
  );
3463
- const onAudioToggleKeyDownHandler = useCallback(
3464
- (event) => {
3465
- if (isActivationKey(event)) {
3466
- event.stopPropagation();
3467
- event.preventDefault();
3468
- setIsMuted((prev) => !prev);
3469
- }
3470
- },
3471
- []
3472
- );
3473
3452
  return {
3474
3453
  a11y,
3475
3454
  className,
@@ -3479,9 +3458,7 @@ function useTransparentVideo(props) {
3479
3458
  id,
3480
3459
  shouldMuteVideo,
3481
3460
  onAudioToggleClickHandler,
3482
- onAudioToggleKeyDownHandler,
3483
3461
  onClickHandler,
3484
- onKeyDownHandler,
3485
3462
  onMouseEnterHandler,
3486
3463
  onMouseOutHandler,
3487
3464
  shouldAutoplay,
@@ -3582,9 +3559,7 @@ function TransparentVideo(props) {
3582
3559
  isPlaying,
3583
3560
  shouldMuteVideo,
3584
3561
  onAudioToggleClickHandler,
3585
- onAudioToggleKeyDownHandler,
3586
3562
  onClickHandler,
3587
- onKeyDownHandler,
3588
3563
  onMouseEnterHandler,
3589
3564
  onMouseOutHandler,
3590
3565
  shouldAutoplay,
@@ -3612,10 +3587,7 @@ function TransparentVideo(props) {
3612
3587
  className: clsx(styles.mainWrapper, className, "wixui-transparent-video"),
3613
3588
  "data-has-alpha": "true",
3614
3589
  "data-playing": shouldAutoplay ? "" : void 0,
3615
- tabIndex: 0,
3616
- "aria-label": (a11y == null ? void 0 : a11y.ariaLabel) || void 0,
3617
3590
  onClick: onClickHandler,
3618
- onKeyDown: onKeyDownHandler,
3619
3591
  onMouseEnter: onMouseEnterHandler,
3620
3592
  onMouseLeave: onMouseOutHandler,
3621
3593
  children: [
@@ -3630,7 +3602,11 @@ function TransparentVideo(props) {
3630
3602
  {
3631
3603
  id: `wix-video-${id}`,
3632
3604
  videoRef,
3633
- videoMedia: { ...video, name: (a11y == null ? void 0 : a11y.ariaLabel) || video.name },
3605
+ videoMedia: {
3606
+ ...video,
3607
+ name: (a11y == null ? void 0 : a11y.ariaHidden) ? "" : (a11y == null ? void 0 : a11y.ariaLabel) || video.name || "",
3608
+ poster: video.poster && { ...video.poster, alt: "" }
3609
+ },
3634
3610
  muted: shouldMuteVideo,
3635
3611
  loop: videoEndType === VideoEndType.loop,
3636
3612
  autoplay: shouldAutoplay,
@@ -3652,31 +3628,29 @@ function TransparentVideo(props) {
3652
3628
  "webglcanvas",
3653
3629
  shouldHideCanvas && styles.hidden
3654
3630
  ),
3655
- "aria-label": (a11y == null ? void 0 : a11y.ariaLabel) || "",
3656
3631
  role: "presentation",
3657
3632
  "data-testid": "canvas"
3658
3633
  }
3659
3634
  )
3660
3635
  ] }),
3661
3636
  shouldDisplayAudioToggle && /* @__PURE__ */ jsx(
3662
- "div",
3637
+ "button",
3663
3638
  {
3639
+ type: "button",
3664
3640
  className: clsx(styles.audioToggle),
3665
- tabIndex: 0,
3666
3641
  "aria-label": isMuted ? "Unmute video" : "Mute video",
3667
3642
  onClick: onAudioToggleClickHandler,
3668
- onKeyDown: onAudioToggleKeyDownHandler,
3669
3643
  "data-testid": "audio-toggle",
3670
3644
  children: isMuted ? /* @__PURE__ */ jsx(MutedIcon, {}) : /* @__PURE__ */ jsx(UnMutedIcon, {})
3671
3645
  }
3672
3646
  ),
3673
- shouldDisplayPlayButton && /* @__PURE__ */ jsx(
3674
- "div",
3647
+ shouldDisplayPlayButton && // Activating the button (click, Enter or Space) bubbles to the player's onClick
3648
+ /* @__PURE__ */ jsx(
3649
+ "button",
3675
3650
  {
3651
+ type: "button",
3676
3652
  className: clsx(styles.playWrapper, { [styles.isShown]: !isPlaying }),
3677
- tabIndex: 0,
3678
- "aria-label": (a11y == null ? void 0 : a11y.ariaLabel) || void 0,
3679
- onKeyDown: onKeyDownHandler,
3653
+ "aria-label": isPlaying ? "Pause" : "Play",
3680
3654
  "data-testid": "play-button",
3681
3655
  children: isPlaying ? /* @__PURE__ */ jsx(PauseIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
3682
3656
  }
@@ -13,8 +13,18 @@
13
13
  .mainWrapper__gc4Bd:hover .playWrapper__yH3ix svg {
14
14
  transform: scale(1.05);
15
15
  }
16
- .mainWrapper__gc4Bd:focus-visible .playWrapper__yH3ix {
17
- opacity: 1;
16
+
17
+ .playWrapper__yH3ix,
18
+ .audioToggle__k2EqB {
19
+ appearance: none;
20
+ background: none;
21
+ border: 0;
22
+ padding: 0;
23
+ margin: 0;
24
+ color: inherit;
25
+ font: inherit;
26
+ cursor: pointer;
27
+ display: flex;
18
28
  }
19
29
 
20
30
  .videoWrapper__e-kgj {
@@ -1,17 +1,15 @@
1
- import { KeyboardEvent, MouseEvent } from 'react';
1
+ import { MouseEvent } from 'react';
2
2
  import { TransparentVideoProps, VideoEndType } from './TransparentVideo.types';
3
3
  export declare function useTransparentVideo(props: TransparentVideoProps): {
4
- a11y: Pick<typeof import('@wix/ambassador-devcenter-v1-component-type-data/types').A11yAttributes, "ariaLabel"> | undefined;
4
+ a11y: Partial<typeof import('@wix/ambassador-devcenter-v1-component-type-data/types').A11yAttributes> | undefined;
5
5
  className: string | undefined;
6
6
  canvasRef: import('react').RefObject<HTMLCanvasElement>;
7
7
  isMuted: boolean;
8
8
  isPlaying: boolean;
9
9
  id: string;
10
10
  shouldMuteVideo: boolean;
11
- onAudioToggleClickHandler: (event: MouseEvent<HTMLDivElement>) => void;
12
- onAudioToggleKeyDownHandler: (event: KeyboardEvent<HTMLDivElement>) => void;
11
+ onAudioToggleClickHandler: (event: MouseEvent<HTMLButtonElement>) => void;
13
12
  onClickHandler: () => void;
14
- onKeyDownHandler: (event: KeyboardEvent<HTMLDivElement>) => void;
15
13
  onMouseEnterHandler: () => void;
16
14
  onMouseOutHandler: () => void;
17
15
  shouldAutoplay: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2791.0",
3
+ "version": "1.2793.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -222,5 +222,5 @@
222
222
  "registry": "https://registry.npmjs.org/",
223
223
  "access": "public"
224
224
  },
225
- "falconPackageHash": "3c9322a0775e296eb0a5409dcf55b782f474434ad18f614a1308ec9d"
225
+ "falconPackageHash": "14fc0f14bf234b2ed1eb3bfcbb254f7b2a1ea2a5adc15ae2db8e4e6b"
226
226
  }