@micromag/screen-urbania-recommendation 0.4.69 → 0.4.71

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/es/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ForwardedRef } from 'react';
2
3
  import { HeadingElement, VisualElement, TextElement, Header, Footer, BackgroundElement, BoxStyle, Color } from '@micromag/core';
3
4
 
4
5
  interface UrbaniaRecommendationProps {
@@ -22,9 +23,10 @@ interface UrbaniaRecommendationProps {
22
23
  current?: boolean;
23
24
  active?: boolean;
24
25
  preload?: boolean;
26
+ mediaRef?: ForwardedRef<HTMLMediaElement> | null;
25
27
  className?: string | null;
26
28
  }
27
- declare function UrbaniaRecommendation({ layout, category, visual, title, date, location, description, sponsor, spacing, header, footer, background, cardBoxStyle, lineColor, withoutZoom, current, active, preload, className, }: UrbaniaRecommendationProps): react_jsx_runtime.JSX.Element;
29
+ declare function UrbaniaRecommendation({ layout, category, visual, title, date, location, description, sponsor, spacing, header, footer, background, cardBoxStyle, lineColor, withoutZoom, current, active, preload, mediaRef: customMediaRef, className, }: UrbaniaRecommendationProps): react_jsx_runtime.JSX.Element;
28
30
 
29
31
  declare const _default: {
30
32
  id: string;
package/es/index.js CHANGED
@@ -7,7 +7,7 @@ import { useState, useMemo, useEffect, useCallback } from 'react';
7
7
  import { Close, ScreenElement, MuteIcon, FullscreenIcon, PlaceholderImage, PlaceholderText, PlaceholderTitle } from '@micromag/core/components';
8
8
  import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerInteraction, useScreenRenderContext } from '@micromag/core/contexts';
9
9
  import { useTrackScreenEvent, useResizeObserver } from '@micromag/core/hooks';
10
- import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getColorAsString, getStyleFromBox, getStyleFromText } from '@micromag/core/utils';
10
+ import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getColorAsString, getStyleFromBox, mergeRefs, getStyleFromText } from '@micromag/core/utils';
11
11
  import Background from '@micromag/element-background';
12
12
  import Button from '@micromag/element-button';
13
13
  import Container from '@micromag/element-container';
@@ -59,6 +59,8 @@ function UrbaniaRecommendation(_ref) {
59
59
  active = _ref$active === void 0 ? true : _ref$active,
60
60
  _ref$preload = _ref.preload,
61
61
  preload = _ref$preload === void 0 ? true : _ref$preload,
62
+ _ref$mediaRef = _ref.mediaRef,
63
+ customMediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
62
64
  _ref$className = _ref.className,
63
65
  className = _ref$className === void 0 ? null : _ref$className;
64
66
  var intl = useIntl();
@@ -504,7 +506,7 @@ function UrbaniaRecommendation(_ref) {
504
506
  },
505
507
  children: [isVideo ? /*#__PURE__*/jsx(Visual, {
506
508
  media: image,
507
- mediaRef: mediaRef,
509
+ mediaRef: mergeRefs(mediaRef, customMediaRef),
508
510
  width: visualModalTransitioning || visualModalOpened ? width : (width - 40) * 0.9 + 1 // ((width - margins) * card width + gapfix )
509
511
  ,
510
512
  height: visualModalTransitioning || visualModalOpened ? height : 250,
@@ -684,7 +686,7 @@ function UrbaniaRecommendation(_ref) {
684
686
  playing: backgroundPlaying && !visualModalOpened,
685
687
  muted: muted || visualModalOpened,
686
688
  shouldLoad: mediaShouldLoad,
687
- mediaRef: mediaRef,
689
+ mediaRef: mergeRefs(mediaRef, customMediaRef),
688
690
  withoutVideo: isPreview,
689
691
  className: styles.background
690
692
  }), backgroundText !== null && finalBackgroundText.length > 0 ? /*#__PURE__*/jsx(Container, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-recommendation",
3
- "version": "0.4.69",
3
+ "version": "0.4.71",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -61,18 +61,18 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@babel/runtime": "^7.28.6",
64
- "@micromag/core": "^0.4.69",
65
- "@micromag/element-background": "^0.4.69",
66
- "@micromag/element-button": "^0.4.69",
67
- "@micromag/element-container": "^0.4.69",
68
- "@micromag/element-footer": "^0.4.69",
69
- "@micromag/element-header": "^0.4.69",
70
- "@micromag/element-heading": "^0.4.69",
71
- "@micromag/element-layout": "^0.4.69",
72
- "@micromag/element-scroll": "^0.4.69",
73
- "@micromag/element-text": "^0.4.69",
74
- "@micromag/element-visual": "^0.4.69",
75
- "@micromag/transforms": "^0.4.69",
64
+ "@micromag/core": "^0.4.71",
65
+ "@micromag/element-background": "^0.4.71",
66
+ "@micromag/element-button": "^0.4.71",
67
+ "@micromag/element-container": "^0.4.71",
68
+ "@micromag/element-footer": "^0.4.71",
69
+ "@micromag/element-header": "^0.4.71",
70
+ "@micromag/element-heading": "^0.4.71",
71
+ "@micromag/element-layout": "^0.4.71",
72
+ "@micromag/element-scroll": "^0.4.71",
73
+ "@micromag/element-text": "^0.4.71",
74
+ "@micromag/element-visual": "^0.4.71",
75
+ "@micromag/transforms": "^0.4.71",
76
76
  "classnames": "^2.2.6",
77
77
  "lodash": "^4.17.23",
78
78
  "react-intl": "^8.1.3 || ^10.0.0",
@@ -82,6 +82,6 @@
82
82
  "access": "public",
83
83
  "registry": "https://registry.npmjs.org/"
84
84
  },
85
- "gitHead": "509e113dc06022d6092e4aac9f47ccd5facfd59d",
85
+ "gitHead": "9101554bc5761e32b4a002a10d26800608c69773",
86
86
  "types": "es/index.d.ts"
87
87
  }