@micromag/screen-urbania-recommendation 0.4.70 → 0.4.74
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 +4 -2
- package/es/index.js +399 -458
- package/package.json +19 -18
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardedRef } from 'react';
|
|
3
|
+
import { HeadingElement, VisualElement, TextElement, Header, Footer, BackgroundElement, BoxStyle, Color, MediaElement } from '@micromag/core';
|
|
3
4
|
|
|
4
5
|
interface UrbaniaRecommendationProps {
|
|
5
6
|
layout?: string | null;
|
|
@@ -22,9 +23,10 @@ interface UrbaniaRecommendationProps {
|
|
|
22
23
|
current?: boolean;
|
|
23
24
|
active?: boolean;
|
|
24
25
|
preload?: boolean;
|
|
26
|
+
mediaRef?: ForwardedRef<MediaElement> | 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
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { useIntl, FormattedMessage, defineMessage } from 'react-intl';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
2
|
import classNames from 'classnames';
|
|
6
3
|
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
7
4
|
import { Close, ScreenElement, MuteIcon, FullscreenIcon, PlaceholderImage, PlaceholderText, PlaceholderTitle } from '@micromag/core/components';
|
|
8
5
|
import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerInteraction, useScreenRenderContext } from '@micromag/core/contexts';
|
|
9
6
|
import { useTrackScreenEvent, useResizeObserver } from '@micromag/core/hooks';
|
|
10
|
-
import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getColorAsString, getStyleFromBox, getStyleFromText } from '@micromag/core/utils';
|
|
7
|
+
import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getColorAsString, getStyleFromBox, mergeRefs, getStyleFromText } from '@micromag/core/utils';
|
|
11
8
|
import Background from '@micromag/element-background';
|
|
12
9
|
import Button from '@micromag/element-button';
|
|
13
10
|
import Container from '@micromag/element-container';
|
|
@@ -22,185 +19,156 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
22
19
|
|
|
23
20
|
var styles = {"container":"micromag-screen-urbania-recommendation-container","background":"micromag-screen-urbania-recommendation-background","backgroundTextContainer":"micromag-screen-urbania-recommendation-backgroundTextContainer","backgroundText":"micromag-screen-urbania-recommendation-backgroundText","hidden":"micromag-screen-urbania-recommendation-hidden","didAnimate":"micromag-screen-urbania-recommendation-didAnimate","animateFromBottom":"micromag-screen-urbania-recommendation-animateFromBottom","animateFromTop":"micromag-screen-urbania-recommendation-animateFromTop","content":"micromag-screen-urbania-recommendation-content","scroll":"micromag-screen-urbania-recommendation-scroll","empty":"micromag-screen-urbania-recommendation-empty","emptyText":"micromag-screen-urbania-recommendation-emptyText","emptyVisual":"micromag-screen-urbania-recommendation-emptyVisual","emptyCategory":"micromag-screen-urbania-recommendation-emptyCategory","footer":"micromag-screen-urbania-recommendation-footer","disabled":"micromag-screen-urbania-recommendation-disabled","close":"micromag-screen-urbania-recommendation-close","closeIcon":"micromag-screen-urbania-recommendation-closeIcon","textCard":"micromag-screen-urbania-recommendation-textCard","isPlaceholder":"micromag-screen-urbania-recommendation-isPlaceholder","appear":"micromag-screen-urbania-recommendation-appear","visualContainer":"micromag-screen-urbania-recommendation-visualContainer","visualBottom":"micromag-screen-urbania-recommendation-visualBottom","modalOpened":"micromag-screen-urbania-recommendation-modalOpened","sponsor":"micromag-screen-urbania-recommendation-sponsor","hasVisual":"micromag-screen-urbania-recommendation-hasVisual","sponsorPlaceholder":"micromag-screen-urbania-recommendation-sponsorPlaceholder","visualWrapper":"micromag-screen-urbania-recommendation-visualWrapper","visualButton":"micromag-screen-urbania-recommendation-visualButton","transitioning":"micromag-screen-urbania-recommendation-transitioning","iconContainer":"micromag-screen-urbania-recommendation-iconContainer","icon":"micromag-screen-urbania-recommendation-icon","text":"micromag-screen-urbania-recommendation-text","categoryContainer":"micromag-screen-urbania-recommendation-categoryContainer","category":"micromag-screen-urbania-recommendation-category","categoryPlaceholder":"micromag-screen-urbania-recommendation-categoryPlaceholder","textContent":"micromag-screen-urbania-recommendation-textContent","withoutCategory":"micromag-screen-urbania-recommendation-withoutCategory","title":"micromag-screen-urbania-recommendation-title","description":"micromag-screen-urbania-recommendation-description","location":"micromag-screen-urbania-recommendation-location","date":"micromag-screen-urbania-recommendation-date","titleContainer":"micromag-screen-urbania-recommendation-titleContainer","border":"micromag-screen-urbania-recommendation-border","descriptionPlaceholder":"micromag-screen-urbania-recommendation-descriptionPlaceholder","layout":"micromag-screen-urbania-recommendation-layout"};
|
|
24
21
|
|
|
25
|
-
function UrbaniaRecommendation(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var isVideoLandscape = hasVisual && isVideo && videoWidth > videoHeight;
|
|
119
|
-
var hasCategory = isTextFilled(category);
|
|
120
|
-
var hasTitle = isTextFilled(title);
|
|
121
|
-
var hasDate = isTextFilled(date);
|
|
122
|
-
var hasLocation = isTextFilled(location);
|
|
123
|
-
var hasDescription = isTextFilled(description);
|
|
124
|
-
var hasSponsor = isTextFilled(sponsor);
|
|
125
|
-
var hasTextCard = hasCategory || hasTitle || hasDate || hasLocation || hasDescription || hasSponsor;
|
|
126
|
-
var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
|
|
127
|
-
var videoPlaying = current && (isView || isEdit) && playing && (isCurrentMedia || !isView);
|
|
128
|
-
var mediaShouldLoad = current || preload;
|
|
129
|
-
var scrollingDisabled = !isView && !isEdit || !current;
|
|
130
|
-
var hasHeader = isHeaderFilled(header);
|
|
131
|
-
var hasFooter = isFooterFilled(footer);
|
|
132
|
-
var footerProps = getFooterProps(footer, {
|
|
133
|
-
isView: isView,
|
|
134
|
-
current: current,
|
|
135
|
-
openWebView: openWebView,
|
|
136
|
-
isPreview: isPreview
|
|
22
|
+
function UrbaniaRecommendation({
|
|
23
|
+
layout = null,
|
|
24
|
+
category = null,
|
|
25
|
+
visual = null,
|
|
26
|
+
title = null,
|
|
27
|
+
date = null,
|
|
28
|
+
location = null,
|
|
29
|
+
description = null,
|
|
30
|
+
sponsor = null,
|
|
31
|
+
spacing = 20,
|
|
32
|
+
header = null,
|
|
33
|
+
footer = null,
|
|
34
|
+
background = null,
|
|
35
|
+
cardBoxStyle = null,
|
|
36
|
+
lineColor = null,
|
|
37
|
+
withoutZoom = false,
|
|
38
|
+
current = true,
|
|
39
|
+
active = true,
|
|
40
|
+
preload = true,
|
|
41
|
+
mediaRef: customMediaRef = null,
|
|
42
|
+
className = null
|
|
43
|
+
}) {
|
|
44
|
+
const intl = useIntl();
|
|
45
|
+
const trackScreenEvent = useTrackScreenEvent();
|
|
46
|
+
const {
|
|
47
|
+
width,
|
|
48
|
+
height,
|
|
49
|
+
resolution
|
|
50
|
+
} = useScreenSize();
|
|
51
|
+
const {
|
|
52
|
+
topHeight: viewerTopHeight,
|
|
53
|
+
bottomHeight: viewerBottomHeight,
|
|
54
|
+
bottomSidesWidth: viewerBottomSidesWidth
|
|
55
|
+
} = useViewerContext();
|
|
56
|
+
const {
|
|
57
|
+
open: openWebView
|
|
58
|
+
} = useViewerWebView();
|
|
59
|
+
const {
|
|
60
|
+
playing,
|
|
61
|
+
setPlaying,
|
|
62
|
+
muted,
|
|
63
|
+
setMuted
|
|
64
|
+
} = usePlaybackContext();
|
|
65
|
+
const {
|
|
66
|
+
ref: mediaRef,
|
|
67
|
+
isCurrent: isCurrentMedia = false
|
|
68
|
+
} = usePlaybackMediaRef(current, true);
|
|
69
|
+
const {
|
|
70
|
+
enableInteraction,
|
|
71
|
+
disableInteraction
|
|
72
|
+
} = useViewerInteraction();
|
|
73
|
+
const {
|
|
74
|
+
isView,
|
|
75
|
+
isPreview,
|
|
76
|
+
isPlaceholder,
|
|
77
|
+
isEdit,
|
|
78
|
+
isStatic
|
|
79
|
+
} = useScreenRenderContext();
|
|
80
|
+
const animateBackground = current && !isPlaceholder && !isStatic && !isPreview && !isEdit;
|
|
81
|
+
const [backgroundAnimationStarted, setBackgroundAnimationStarted] = useState(animateBackground);
|
|
82
|
+
const [didAnimate, setDidAnimate] = useState(false);
|
|
83
|
+
const {
|
|
84
|
+
image = null
|
|
85
|
+
} = visual || {}; // note: image can be a video
|
|
86
|
+
const {
|
|
87
|
+
type = null,
|
|
88
|
+
metadata: videoMetadata = null
|
|
89
|
+
} = image || {};
|
|
90
|
+
const {
|
|
91
|
+
width: videoWidth = 0,
|
|
92
|
+
height: videoHeight = 0
|
|
93
|
+
} = videoMetadata || {};
|
|
94
|
+
const hasVisual = image !== null;
|
|
95
|
+
const isVideo = type === 'video';
|
|
96
|
+
const isVideoLandscape = hasVisual && isVideo && videoWidth > videoHeight;
|
|
97
|
+
const hasCategory = isTextFilled(category);
|
|
98
|
+
const hasTitle = isTextFilled(title);
|
|
99
|
+
const hasDate = isTextFilled(date);
|
|
100
|
+
const hasLocation = isTextFilled(location);
|
|
101
|
+
const hasDescription = isTextFilled(description);
|
|
102
|
+
const hasSponsor = isTextFilled(sponsor);
|
|
103
|
+
const hasTextCard = hasCategory || hasTitle || hasDate || hasLocation || hasDescription || hasSponsor;
|
|
104
|
+
const backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
|
|
105
|
+
const videoPlaying = current && (isView || isEdit) && playing && (isCurrentMedia || !isView);
|
|
106
|
+
const mediaShouldLoad = current || preload;
|
|
107
|
+
const scrollingDisabled = !isView && !isEdit || !current;
|
|
108
|
+
const hasHeader = isHeaderFilled(header);
|
|
109
|
+
const hasFooter = isFooterFilled(footer);
|
|
110
|
+
const footerProps = getFooterProps(footer, {
|
|
111
|
+
isView,
|
|
112
|
+
current,
|
|
113
|
+
openWebView,
|
|
114
|
+
isPreview
|
|
137
115
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var _ref6 = background || {},
|
|
161
|
-
_ref6$text = _ref6.text,
|
|
162
|
-
backgroundText = _ref6$text === void 0 ? null : _ref6$text;
|
|
163
|
-
var _ref7 = backgroundText || {},
|
|
164
|
-
_ref7$body = _ref7.body,
|
|
165
|
-
backgroundTextBody = _ref7$body === void 0 ? null : _ref7$body,
|
|
166
|
-
backgroundTextStyle = _ref7.textStyle;
|
|
167
|
-
var finalBackgroundText = useMemo(function () {
|
|
116
|
+
const [scrolledBottom, setScrolledBottom] = useState(false);
|
|
117
|
+
const {
|
|
118
|
+
ref: textContainerRef,
|
|
119
|
+
entry: {
|
|
120
|
+
contentRect: textContainerRect = null
|
|
121
|
+
}
|
|
122
|
+
} = useResizeObserver();
|
|
123
|
+
const {
|
|
124
|
+
width: textContainerWidth = 0,
|
|
125
|
+
height: textContainerHeight = 0
|
|
126
|
+
} = textContainerRect || {};
|
|
127
|
+
const [visualModalTransitioning, setVisualModalTransitioning] = useState(false);
|
|
128
|
+
const [visualModalOpened, setVisualModalOpened] = useState(false);
|
|
129
|
+
const visualModalClosed = !visualModalTransitioning && !visualModalOpened;
|
|
130
|
+
const {
|
|
131
|
+
text: backgroundText = null
|
|
132
|
+
} = background || {};
|
|
133
|
+
const {
|
|
134
|
+
body: backgroundTextBody = null,
|
|
135
|
+
textStyle: backgroundTextStyle
|
|
136
|
+
} = backgroundText || {};
|
|
137
|
+
const finalBackgroundText = useMemo(() => {
|
|
168
138
|
function distributeTextEqually(text) {
|
|
169
|
-
|
|
170
|
-
|
|
139
|
+
const words = text !== null ? text.split(' ') : [];
|
|
140
|
+
const numRows = 4;
|
|
171
141
|
if (words.length < numRows / 2) {
|
|
172
142
|
return Array(numRows).fill(text);
|
|
173
143
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
144
|
+
const halfNumWords = Math.ceil(words.length / 2);
|
|
145
|
+
const firstHalf = words.slice(0, halfNumWords).join(' ');
|
|
146
|
+
const secondHalf = words.slice(halfNumWords).join(' ');
|
|
177
147
|
return [firstHalf, secondHalf, firstHalf, secondHalf];
|
|
178
148
|
}
|
|
179
|
-
|
|
149
|
+
const textArray = distributeTextEqually(backgroundTextBody);
|
|
180
150
|
|
|
181
151
|
// @TODO: move container div here to avoid double map
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
});
|
|
186
|
-
});
|
|
152
|
+
const textElements = (textArray || []).map(line => /*#__PURE__*/jsx("span", {
|
|
153
|
+
children: line
|
|
154
|
+
}));
|
|
187
155
|
return textElements;
|
|
188
156
|
}, [backgroundTextBody]);
|
|
189
157
|
|
|
190
158
|
// intro animation
|
|
191
|
-
useEffect(
|
|
192
|
-
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
let id = null;
|
|
193
161
|
if (backgroundAnimationStarted) {
|
|
194
|
-
id = setTimeout(
|
|
162
|
+
id = setTimeout(() => {
|
|
195
163
|
setBackgroundAnimationStarted(false);
|
|
196
164
|
setDidAnimate(true);
|
|
197
165
|
}, 1600);
|
|
198
166
|
}
|
|
199
|
-
return
|
|
167
|
+
return () => {
|
|
200
168
|
clearTimeout(id);
|
|
201
169
|
};
|
|
202
170
|
}, [backgroundAnimationStarted, animateBackground, setDidAnimate, setBackgroundAnimationStarted]);
|
|
203
|
-
useEffect(
|
|
171
|
+
useEffect(() => {
|
|
204
172
|
if (isView && !isStatic && current) {
|
|
205
173
|
setBackgroundAnimationStarted(true);
|
|
206
174
|
} else {
|
|
@@ -209,31 +177,31 @@ function UrbaniaRecommendation(_ref) {
|
|
|
209
177
|
}, [isView, current, setBackgroundAnimationStarted]);
|
|
210
178
|
|
|
211
179
|
// scroll events
|
|
212
|
-
|
|
213
|
-
|
|
180
|
+
const onScrolledBottom = useCallback(({
|
|
181
|
+
initial
|
|
182
|
+
}) => {
|
|
214
183
|
if (initial) {
|
|
215
184
|
trackScreenEvent('scroll', 'Screen');
|
|
216
185
|
}
|
|
217
186
|
setScrolledBottom(true);
|
|
218
187
|
}, [trackScreenEvent]);
|
|
219
|
-
|
|
188
|
+
const onScrolledNotBottom = useCallback(() => {
|
|
220
189
|
setScrolledBottom(false);
|
|
221
190
|
}, [setScrolledBottom]);
|
|
222
|
-
|
|
223
|
-
var trigger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
191
|
+
const onScrolledTrigger = useCallback((trigger = null) => {
|
|
224
192
|
if (trigger !== null) {
|
|
225
|
-
|
|
193
|
+
const scrollPercent = Math.round(trigger * 100);
|
|
226
194
|
trackScreenEvent('scroll', scrollPercent, {
|
|
227
|
-
scrollPercent
|
|
195
|
+
scrollPercent
|
|
228
196
|
});
|
|
229
197
|
}
|
|
230
198
|
}, [trackScreenEvent]);
|
|
231
199
|
|
|
232
200
|
// modal
|
|
233
|
-
useEffect(
|
|
234
|
-
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
let id_0 = null;
|
|
235
203
|
if (visualModalTransitioning) {
|
|
236
|
-
|
|
204
|
+
id_0 = setTimeout(() => {
|
|
237
205
|
setVisualModalTransitioning(false);
|
|
238
206
|
setVisualModalOpened(true);
|
|
239
207
|
}, 400);
|
|
@@ -241,11 +209,11 @@ function UrbaniaRecommendation(_ref) {
|
|
|
241
209
|
if (!current) {
|
|
242
210
|
setVisualModalOpened(false);
|
|
243
211
|
}
|
|
244
|
-
return
|
|
245
|
-
clearTimeout(
|
|
212
|
+
return () => {
|
|
213
|
+
clearTimeout(id_0);
|
|
246
214
|
};
|
|
247
215
|
}, [visualModalTransitioning, setVisualModalTransitioning, current]);
|
|
248
|
-
|
|
216
|
+
const onClickVisual = useCallback(() => {
|
|
249
217
|
if (!visualModalOpened) {
|
|
250
218
|
setVisualModalTransitioning(true);
|
|
251
219
|
}
|
|
@@ -253,21 +221,21 @@ function UrbaniaRecommendation(_ref) {
|
|
|
253
221
|
setMuted(false);
|
|
254
222
|
}
|
|
255
223
|
}, [setVisualModalOpened]);
|
|
256
|
-
|
|
224
|
+
const onCloseModal = useCallback(() => {
|
|
257
225
|
if (visualModalTransitioning) {
|
|
258
226
|
setVisualModalTransitioning(false);
|
|
259
227
|
}
|
|
260
228
|
setVisualModalOpened(false);
|
|
261
229
|
}, [setVisualModalOpened]);
|
|
262
|
-
useEffect(
|
|
230
|
+
useEffect(() => {
|
|
263
231
|
if (visualModalOpened) {
|
|
264
232
|
disableInteraction();
|
|
265
233
|
} else {
|
|
266
234
|
enableInteraction();
|
|
267
235
|
}
|
|
268
236
|
}, [current, visualModalOpened]);
|
|
269
|
-
useEffect(
|
|
270
|
-
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
const keyup = e => {
|
|
271
239
|
if (e.key === 'Escape') {
|
|
272
240
|
if (visualModalOpened) {
|
|
273
241
|
onCloseModal();
|
|
@@ -275,143 +243,143 @@ function UrbaniaRecommendation(_ref) {
|
|
|
275
243
|
}
|
|
276
244
|
};
|
|
277
245
|
document.addEventListener('keyup', keyup);
|
|
278
|
-
return
|
|
246
|
+
return () => {
|
|
279
247
|
document.removeEventListener('keyup', keyup);
|
|
280
248
|
};
|
|
281
249
|
}, [visualModalOpened, onCloseModal]);
|
|
282
250
|
|
|
283
251
|
// Modal video
|
|
284
252
|
|
|
285
|
-
useEffect(
|
|
253
|
+
useEffect(() => {
|
|
286
254
|
if (current && !backgroundAnimationStarted) {
|
|
287
255
|
setPlaying(true);
|
|
288
256
|
}
|
|
289
257
|
}, [current, backgroundAnimationStarted]);
|
|
290
258
|
|
|
291
259
|
// Default font weights ++ for urbania styles
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return lineColor !== null ? getColorAsString(lineColor) : titleColor;
|
|
412
|
-
}, [lineColor, titleColor]);
|
|
260
|
+
const {
|
|
261
|
+
titleTextStyle,
|
|
262
|
+
titleColor,
|
|
263
|
+
titleFontWeight,
|
|
264
|
+
titleFontStyle,
|
|
265
|
+
categoryTextStyle,
|
|
266
|
+
categoryFontWeight,
|
|
267
|
+
categoryFontStyle,
|
|
268
|
+
descriptionTextStyle,
|
|
269
|
+
descriptionFontWeight,
|
|
270
|
+
dateTextStyle,
|
|
271
|
+
dateFontStyle,
|
|
272
|
+
locationTextStyle,
|
|
273
|
+
locationFontStyle,
|
|
274
|
+
sponsorTextStyle,
|
|
275
|
+
sponsorFontStyle,
|
|
276
|
+
backgroundFontStyle
|
|
277
|
+
} = useMemo(() => {
|
|
278
|
+
const {
|
|
279
|
+
textStyle: finalTitleTextStyle = null
|
|
280
|
+
} = title || {};
|
|
281
|
+
const {
|
|
282
|
+
color: titleStyleColor = null,
|
|
283
|
+
fontFamily: titleFontFamily = null,
|
|
284
|
+
fontStyle: titleFontStyles = null
|
|
285
|
+
} = finalTitleTextStyle || {};
|
|
286
|
+
const finalTitleColor = getColorAsString(titleStyleColor);
|
|
287
|
+
const finalTitleFontWeight = titleFontFamily === null ? 700 : null;
|
|
288
|
+
const finalTextTransform = titleFontFamily === null ? 'uppercase' : null;
|
|
289
|
+
const finalTitleFontStyle = titleFontFamily === null ? {
|
|
290
|
+
...titleFontStyles,
|
|
291
|
+
transform: 'uppercase'
|
|
292
|
+
} : titleFontStyles;
|
|
293
|
+
const {
|
|
294
|
+
textStyle: finalCategoryTextStyle = null
|
|
295
|
+
} = category || {};
|
|
296
|
+
const {
|
|
297
|
+
fontFamily: categoryFontFamily = null,
|
|
298
|
+
fontStyle: categoryFontStyles = null
|
|
299
|
+
} = finalCategoryTextStyle || {};
|
|
300
|
+
const finalCategoryFontWeight = categoryFontFamily === null ? 900 : null;
|
|
301
|
+
const finalCategoryFontStyle = categoryFontFamily === null ? {
|
|
302
|
+
...categoryFontStyles,
|
|
303
|
+
transform: 'uppercase'
|
|
304
|
+
} : categoryFontStyles;
|
|
305
|
+
const {
|
|
306
|
+
textStyle: finalDescriptionTextStyle = null
|
|
307
|
+
} = description || {};
|
|
308
|
+
const {
|
|
309
|
+
fontFamily: descriptionFontFamily = null
|
|
310
|
+
} = finalDescriptionTextStyle || {};
|
|
311
|
+
const finalDescriptionFontWeight = descriptionFontFamily === null ? 300 : null;
|
|
312
|
+
const {
|
|
313
|
+
textStyle: finalDateTextStyle = null
|
|
314
|
+
} = date || {};
|
|
315
|
+
const {
|
|
316
|
+
fontFamily: dateFontFamily = null,
|
|
317
|
+
fontStyle: dateFontStyles = null
|
|
318
|
+
} = finalDateTextStyle || {};
|
|
319
|
+
const finalDateFontStyle = dateFontFamily === null ? {
|
|
320
|
+
...dateFontStyles,
|
|
321
|
+
transform: 'uppercase'
|
|
322
|
+
} : dateFontStyles;
|
|
323
|
+
const {
|
|
324
|
+
textStyle: finalLocationTextStyle = null
|
|
325
|
+
} = location || {};
|
|
326
|
+
const {
|
|
327
|
+
fontFamily: locationFontFamily = null,
|
|
328
|
+
fontStyle: locationFontStyles = null
|
|
329
|
+
} = finalLocationTextStyle || {};
|
|
330
|
+
const finalLocationFontStyle = locationFontFamily === null ? {
|
|
331
|
+
...locationFontStyles,
|
|
332
|
+
transform: 'uppercase'
|
|
333
|
+
} : locationFontStyles;
|
|
334
|
+
const {
|
|
335
|
+
textStyle: finalSponsorTextStyle = null
|
|
336
|
+
} = sponsor || {};
|
|
337
|
+
const {
|
|
338
|
+
fontFamily: sponsorFontFamily = null,
|
|
339
|
+
fontStyle: sponsorFontStyles = null
|
|
340
|
+
} = finalSponsorTextStyle || {};
|
|
341
|
+
const finalSponsorFontStyle = sponsorFontFamily === null ? {
|
|
342
|
+
...sponsorFontStyles,
|
|
343
|
+
transform: 'uppercase'
|
|
344
|
+
} : sponsorFontStyles;
|
|
345
|
+
const {
|
|
346
|
+
fontFamily: backgroundFontFamily = null,
|
|
347
|
+
fontStyle: backgroundFontStyles = null
|
|
348
|
+
} = backgroundTextStyle || {};
|
|
349
|
+
const finalBackgroundFontStyle = backgroundFontFamily === null ? {
|
|
350
|
+
...backgroundFontStyles,
|
|
351
|
+
transform: 'uppercase'
|
|
352
|
+
} : backgroundFontStyles;
|
|
353
|
+
return {
|
|
354
|
+
defaultTextTransform: finalTextTransform,
|
|
355
|
+
titleColor: finalTitleColor,
|
|
356
|
+
titleTextStyle: finalTitleTextStyle,
|
|
357
|
+
titleFontWeight: finalTitleFontWeight,
|
|
358
|
+
titleFontStyle: finalTitleFontStyle,
|
|
359
|
+
categoryTextStyle: finalCategoryTextStyle,
|
|
360
|
+
categoryFontWeight: finalCategoryFontWeight,
|
|
361
|
+
categoryFontStyle: finalCategoryFontStyle,
|
|
362
|
+
descriptionTextStyle: finalDescriptionTextStyle,
|
|
363
|
+
descriptionFontWeight: finalDescriptionFontWeight,
|
|
364
|
+
dateTextStyle: finalDateTextStyle,
|
|
365
|
+
dateFontStyle: finalDateFontStyle,
|
|
366
|
+
locationTextStyle: finalLocationTextStyle,
|
|
367
|
+
locationFontStyle: finalLocationFontStyle,
|
|
368
|
+
sponsorTextStyle: finalSponsorTextStyle,
|
|
369
|
+
sponsorFontStyle: finalSponsorFontStyle,
|
|
370
|
+
backgroundFontStyle: finalBackgroundFontStyle
|
|
371
|
+
};
|
|
372
|
+
}, [title, category, description, date, location, sponsor, backgroundTextStyle]);
|
|
373
|
+
const layoutStyle = !isPlaceholder ? getStyleFromBox(cardBoxStyle) : null;
|
|
374
|
+
const {
|
|
375
|
+
borderRadius: layoutBorderRadius = null
|
|
376
|
+
} = layoutStyle || {};
|
|
377
|
+
const withoutCorners = layoutBorderRadius === 0;
|
|
378
|
+
const finalBorderColor = useMemo(() => lineColor !== null ? getColorAsString(lineColor) : titleColor, [lineColor, titleColor]);
|
|
413
379
|
return /*#__PURE__*/jsxs("div", {
|
|
414
|
-
className: classNames([styles.container, className,
|
|
380
|
+
className: classNames([styles.container, className, {
|
|
381
|
+
[styles.isPlaceholder]: isPlaceholder
|
|
382
|
+
}]),
|
|
415
383
|
"data-screen-ready": true,
|
|
416
384
|
children: [/*#__PURE__*/jsx(Container, {
|
|
417
385
|
width: width,
|
|
@@ -443,7 +411,9 @@ function UrbaniaRecommendation(_ref) {
|
|
|
443
411
|
paddingBottom: spacing
|
|
444
412
|
},
|
|
445
413
|
className: classNames([styles.headerContainer]),
|
|
446
|
-
children: /*#__PURE__*/jsx(Header,
|
|
414
|
+
children: /*#__PURE__*/jsx(Header, {
|
|
415
|
+
...header
|
|
416
|
+
})
|
|
447
417
|
}, "header") : null, !isPlaceholder ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-top") : null, visualModalOpened ? /*#__PURE__*/jsx(Button, {
|
|
448
418
|
className: styles.close,
|
|
449
419
|
onClick: onCloseModal,
|
|
@@ -451,12 +421,23 @@ function UrbaniaRecommendation(_ref) {
|
|
|
451
421
|
className: styles.closeIcon
|
|
452
422
|
})
|
|
453
423
|
}) : null, hasTextCard || isPlaceholder || isEdit ? /*#__PURE__*/jsxs(Container, {
|
|
454
|
-
className: classNames([styles.textCard,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
424
|
+
className: classNames([styles.textCard, {
|
|
425
|
+
[styles.isPlaceholder]: isPlaceholder,
|
|
426
|
+
[styles.visualBottom]: layout === 'bottom',
|
|
427
|
+
[styles.appear]: backgroundAnimationStarted,
|
|
428
|
+
[styles.modalOpened]: visualModalTransitioning || visualModalOpened,
|
|
429
|
+
[styles.hidden]: !current && isView && !isPreview
|
|
430
|
+
}]),
|
|
431
|
+
style: {
|
|
432
|
+
...layoutStyle,
|
|
433
|
+
...(withoutCorners ? {
|
|
434
|
+
borderRadius: 0
|
|
435
|
+
} : null)
|
|
436
|
+
},
|
|
458
437
|
children: [/*#__PURE__*/jsxs("div", {
|
|
459
|
-
className: classNames([styles.visualContainer,
|
|
438
|
+
className: classNames([styles.visualContainer, {
|
|
439
|
+
[styles.modalOpened]: visualModalTransitioning || visualModalOpened
|
|
440
|
+
}]),
|
|
460
441
|
style: layoutBorderRadius !== null ? layout === 'bottom' ? {
|
|
461
442
|
borderBottomLeftRadius: layoutBorderRadius,
|
|
462
443
|
borderBottomRightRadius: layoutBorderRadius
|
|
@@ -470,41 +451,40 @@ function UrbaniaRecommendation(_ref) {
|
|
|
470
451
|
}),
|
|
471
452
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
472
453
|
id: "JzSBzL",
|
|
473
|
-
defaultMessage:
|
|
474
|
-
"type": 0,
|
|
475
|
-
"value": "Visual"
|
|
476
|
-
}]
|
|
454
|
+
defaultMessage: "Visual"
|
|
477
455
|
}),
|
|
478
456
|
emptyClassName: classNames([styles.empty, styles.emptyVisual]),
|
|
479
457
|
isEmpty: !hasVisual,
|
|
480
458
|
children: hasVisual ? /*#__PURE__*/jsx("div", {
|
|
481
|
-
className: classNames([styles.visualWrapper,
|
|
459
|
+
className: classNames([styles.visualWrapper, {
|
|
460
|
+
[styles.modalOpened]: visualModalTransitioning || visualModalOpened
|
|
461
|
+
}]),
|
|
482
462
|
style: visualModalTransitioning || visualModalOpened ? {
|
|
483
|
-
width
|
|
484
|
-
height
|
|
463
|
+
width,
|
|
464
|
+
height
|
|
485
465
|
} : {
|
|
486
466
|
width: textContainerWidth,
|
|
487
467
|
height: 'auto'
|
|
488
468
|
},
|
|
489
469
|
children: /*#__PURE__*/jsxs(Button, {
|
|
490
|
-
className: classNames([styles.visualButton,
|
|
470
|
+
className: classNames([styles.visualButton, {
|
|
471
|
+
[styles.transitioning]: visualModalTransitioning,
|
|
472
|
+
[styles.disabled]: withoutZoom
|
|
473
|
+
}]),
|
|
491
474
|
onClick: onClickVisual,
|
|
492
475
|
disabled: isPreview || backgroundAnimationStarted || visualModalOpened || withoutZoom,
|
|
493
476
|
focusable: current && !isPreview && !visualModalOpened,
|
|
494
477
|
"aria-label": intl.formatMessage({
|
|
495
478
|
id: "XHO5Ua",
|
|
496
|
-
defaultMessage:
|
|
497
|
-
"type": 0,
|
|
498
|
-
"value": "Expand visual"
|
|
499
|
-
}]
|
|
479
|
+
defaultMessage: "Expand visual"
|
|
500
480
|
}),
|
|
501
481
|
"aria-pressed": visualModalOpened,
|
|
502
482
|
style: {
|
|
503
|
-
transform: visualModalTransitioning ?
|
|
483
|
+
transform: visualModalTransitioning ? `scale(${width / textContainerWidth})` : null
|
|
504
484
|
},
|
|
505
485
|
children: [isVideo ? /*#__PURE__*/jsx(Visual, {
|
|
506
486
|
media: image,
|
|
507
|
-
mediaRef: mediaRef,
|
|
487
|
+
mediaRef: mergeRefs(mediaRef, customMediaRef),
|
|
508
488
|
width: visualModalTransitioning || visualModalOpened ? width : (width - 40) * 0.9 + 1 // ((width - margins) * card width + gapfix )
|
|
509
489
|
,
|
|
510
490
|
height: visualModalTransitioning || visualModalOpened ? height : 250,
|
|
@@ -523,7 +503,10 @@ function UrbaniaRecommendation(_ref) {
|
|
|
523
503
|
active: active,
|
|
524
504
|
shouldLoad: mediaShouldLoad
|
|
525
505
|
}), visualModalClosed ? /*#__PURE__*/jsx("div", {
|
|
526
|
-
className: classNames([styles.iconContainer,
|
|
506
|
+
className: classNames([styles.iconContainer, {
|
|
507
|
+
[styles.visualBottom]: layout === 'bottom',
|
|
508
|
+
[styles.hidden]: withoutZoom
|
|
509
|
+
}]),
|
|
527
510
|
children: isVideo ? /*#__PURE__*/jsx(MuteIcon, {
|
|
528
511
|
color: "#000",
|
|
529
512
|
className: styles.icon
|
|
@@ -538,13 +521,16 @@ function UrbaniaRecommendation(_ref) {
|
|
|
538
521
|
placeholder: /*#__PURE__*/jsx(PlaceholderText, {
|
|
539
522
|
className: styles.sponsorPlaceholder
|
|
540
523
|
}),
|
|
541
|
-
children: hasSponsor ? /*#__PURE__*/jsx(Text,
|
|
542
|
-
className: classNames([styles.sponsor,
|
|
543
|
-
|
|
544
|
-
|
|
524
|
+
children: hasSponsor ? /*#__PURE__*/jsx(Text, {
|
|
525
|
+
className: classNames([styles.sponsor, {
|
|
526
|
+
[styles.hasVisual]: hasVisual
|
|
527
|
+
}]),
|
|
528
|
+
...sponsor,
|
|
529
|
+
textStyle: {
|
|
530
|
+
...sponsorTextStyle,
|
|
545
531
|
fontStyle: sponsorFontStyle
|
|
546
|
-
}
|
|
547
|
-
})
|
|
532
|
+
}
|
|
533
|
+
}) : null
|
|
548
534
|
}, "sponsor")]
|
|
549
535
|
}), /*#__PURE__*/jsxs("div", {
|
|
550
536
|
ref: textContainerRef,
|
|
@@ -555,10 +541,7 @@ function UrbaniaRecommendation(_ref) {
|
|
|
555
541
|
}),
|
|
556
542
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
557
543
|
id: "I5+AHN",
|
|
558
|
-
defaultMessage:
|
|
559
|
-
"type": 0,
|
|
560
|
-
"value": "Category"
|
|
561
|
-
}]
|
|
544
|
+
defaultMessage: "Category"
|
|
562
545
|
}),
|
|
563
546
|
emptyClassName: styles.emptyCategory,
|
|
564
547
|
isEmpty: !hasCategory,
|
|
@@ -567,38 +550,40 @@ function UrbaniaRecommendation(_ref) {
|
|
|
567
550
|
style: {
|
|
568
551
|
width: textContainerHeight
|
|
569
552
|
},
|
|
570
|
-
children: /*#__PURE__*/jsx(Heading,
|
|
571
|
-
className: styles.category
|
|
572
|
-
|
|
573
|
-
textStyle:
|
|
553
|
+
children: /*#__PURE__*/jsx(Heading, {
|
|
554
|
+
className: styles.category,
|
|
555
|
+
...category,
|
|
556
|
+
textStyle: {
|
|
557
|
+
...categoryTextStyle,
|
|
574
558
|
fontWeight: categoryFontWeight,
|
|
575
559
|
fontStyle: categoryFontStyle
|
|
576
|
-
}
|
|
577
|
-
})
|
|
560
|
+
}
|
|
561
|
+
})
|
|
578
562
|
}) : null
|
|
579
563
|
}, "category"), /*#__PURE__*/jsxs("div", {
|
|
580
|
-
className: classNames([styles.textContent,
|
|
564
|
+
className: classNames([styles.textContent, {
|
|
565
|
+
[styles.isPlaceholder]: isPlaceholder,
|
|
566
|
+
[styles.withoutCategory]: !hasCategory
|
|
567
|
+
}]),
|
|
581
568
|
children: [/*#__PURE__*/jsx(ScreenElement, {
|
|
582
569
|
placeholder: "title",
|
|
583
570
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
584
571
|
id: "2c1WFV",
|
|
585
|
-
defaultMessage:
|
|
586
|
-
"type": 0,
|
|
587
|
-
"value": "Title"
|
|
588
|
-
}]
|
|
572
|
+
defaultMessage: "Title"
|
|
589
573
|
}),
|
|
590
574
|
emptyClassName: styles.emptyText,
|
|
591
575
|
isEmpty: !hasTitle,
|
|
592
576
|
children: hasTitle ? /*#__PURE__*/jsxs("div", {
|
|
593
577
|
className: styles.titleContainer,
|
|
594
|
-
children: [/*#__PURE__*/jsx(Heading,
|
|
595
|
-
className: styles.title
|
|
596
|
-
|
|
597
|
-
textStyle:
|
|
578
|
+
children: [/*#__PURE__*/jsx(Heading, {
|
|
579
|
+
className: styles.title,
|
|
580
|
+
...title,
|
|
581
|
+
textStyle: {
|
|
582
|
+
...titleTextStyle,
|
|
598
583
|
fontWeight: titleFontWeight,
|
|
599
584
|
fontStyle: titleFontStyle
|
|
600
|
-
}
|
|
601
|
-
})
|
|
585
|
+
}
|
|
586
|
+
}), /*#__PURE__*/jsx("hr", {
|
|
602
587
|
className: styles.border,
|
|
603
588
|
style: {
|
|
604
589
|
borderColor: finalBorderColor
|
|
@@ -610,13 +595,14 @@ function UrbaniaRecommendation(_ref) {
|
|
|
610
595
|
className: styles.datePlaceholder
|
|
611
596
|
}),
|
|
612
597
|
children: hasDate ? /*#__PURE__*/jsxs(Fragment, {
|
|
613
|
-
children: [/*#__PURE__*/jsx(Text,
|
|
614
|
-
className: styles.date
|
|
615
|
-
|
|
616
|
-
textStyle:
|
|
598
|
+
children: [/*#__PURE__*/jsx(Text, {
|
|
599
|
+
className: styles.date,
|
|
600
|
+
...date,
|
|
601
|
+
textStyle: {
|
|
602
|
+
...dateTextStyle,
|
|
617
603
|
fontStyle: dateFontStyle
|
|
618
|
-
}
|
|
619
|
-
})
|
|
604
|
+
}
|
|
605
|
+
}), /*#__PURE__*/jsx("hr", {
|
|
620
606
|
className: styles.border,
|
|
621
607
|
style: {
|
|
622
608
|
borderColor: finalBorderColor
|
|
@@ -628,13 +614,14 @@ function UrbaniaRecommendation(_ref) {
|
|
|
628
614
|
className: styles.locationPlaceholder
|
|
629
615
|
}),
|
|
630
616
|
children: hasLocation ? /*#__PURE__*/jsxs(Fragment, {
|
|
631
|
-
children: [/*#__PURE__*/jsx(Text,
|
|
632
|
-
className: styles.location
|
|
633
|
-
|
|
634
|
-
textStyle:
|
|
617
|
+
children: [/*#__PURE__*/jsx(Text, {
|
|
618
|
+
className: styles.location,
|
|
619
|
+
...location,
|
|
620
|
+
textStyle: {
|
|
621
|
+
...locationTextStyle,
|
|
635
622
|
fontStyle: locationFontStyle
|
|
636
|
-
}
|
|
637
|
-
})
|
|
623
|
+
}
|
|
624
|
+
}), /*#__PURE__*/jsx("hr", {
|
|
638
625
|
className: styles.border,
|
|
639
626
|
style: {
|
|
640
627
|
borderColor: finalBorderColor
|
|
@@ -647,31 +634,33 @@ function UrbaniaRecommendation(_ref) {
|
|
|
647
634
|
}),
|
|
648
635
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
649
636
|
id: "EQdIAR",
|
|
650
|
-
defaultMessage:
|
|
651
|
-
"type": 0,
|
|
652
|
-
"value": "Description"
|
|
653
|
-
}]
|
|
637
|
+
defaultMessage: "Description"
|
|
654
638
|
}),
|
|
655
639
|
emptyClassName: styles.emptyText,
|
|
656
640
|
isEmpty: !hasDescription,
|
|
657
|
-
children: hasDescription ? /*#__PURE__*/jsx(Text,
|
|
658
|
-
className: styles.description
|
|
659
|
-
|
|
660
|
-
textStyle:
|
|
641
|
+
children: hasDescription ? /*#__PURE__*/jsx(Text, {
|
|
642
|
+
className: styles.description,
|
|
643
|
+
...description,
|
|
644
|
+
textStyle: {
|
|
645
|
+
...descriptionTextStyle,
|
|
661
646
|
fontWeight: descriptionFontWeight
|
|
662
|
-
}
|
|
663
|
-
})
|
|
647
|
+
}
|
|
648
|
+
}) : null
|
|
664
649
|
}, "description")]
|
|
665
650
|
})]
|
|
666
651
|
})]
|
|
667
652
|
}) : null, !isPlaceholder ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-bottom") : null, !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
668
|
-
className: classNames([styles.footer,
|
|
653
|
+
className: classNames([styles.footer, {
|
|
654
|
+
[styles.disabled]: !scrolledBottom && !visualModalOpened
|
|
655
|
+
}]),
|
|
669
656
|
style: {
|
|
670
657
|
paddingTop: spacing,
|
|
671
658
|
paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
|
|
672
659
|
paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
|
|
673
660
|
},
|
|
674
|
-
children: /*#__PURE__*/jsx(Footer,
|
|
661
|
+
children: /*#__PURE__*/jsx(Footer, {
|
|
662
|
+
...footerProps
|
|
663
|
+
})
|
|
675
664
|
}, "footer") : null]
|
|
676
665
|
})
|
|
677
666
|
})
|
|
@@ -684,24 +673,30 @@ function UrbaniaRecommendation(_ref) {
|
|
|
684
673
|
playing: backgroundPlaying && !visualModalOpened,
|
|
685
674
|
muted: muted || visualModalOpened,
|
|
686
675
|
shouldLoad: mediaShouldLoad,
|
|
687
|
-
mediaRef: mediaRef,
|
|
676
|
+
mediaRef: mergeRefs(mediaRef, customMediaRef),
|
|
688
677
|
withoutVideo: isPreview,
|
|
689
678
|
className: styles.background
|
|
690
679
|
}), backgroundText !== null && finalBackgroundText.length > 0 ? /*#__PURE__*/jsx(Container, {
|
|
691
680
|
width: width,
|
|
692
681
|
height: height,
|
|
693
682
|
className: styles.backgroundTextContainer,
|
|
694
|
-
children: (finalBackgroundText || []).map(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
683
|
+
children: (finalBackgroundText || []).map((line_0, i) => /*#__PURE__*/jsx("div", {
|
|
684
|
+
className: classNames([styles.backgroundText], {
|
|
685
|
+
[styles.hidden]: !current && isView && !isPreview,
|
|
686
|
+
[styles.didAnimate]: didAnimate,
|
|
687
|
+
// @TODO: optimise —> use animation-fill-mode?
|
|
688
|
+
[styles.animateFromBottom]: backgroundAnimationStarted && i % 2 !== 0,
|
|
689
|
+
[styles.animateFromTop]: backgroundAnimationStarted && i % 2 === 0
|
|
690
|
+
}),
|
|
691
|
+
style: {
|
|
692
|
+
animationDelay: `${i * 100}ms`,
|
|
693
|
+
...getStyleFromText({
|
|
694
|
+
...backgroundTextStyle,
|
|
700
695
|
fontStyle: backgroundFontStyle
|
|
701
|
-
})
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
})
|
|
696
|
+
})
|
|
697
|
+
},
|
|
698
|
+
children: line_0
|
|
699
|
+
}, `reco-background-text-${i + 1}`))
|
|
705
700
|
}) : null]
|
|
706
701
|
}) : null]
|
|
707
702
|
});
|
|
@@ -714,19 +709,13 @@ var definition = [{
|
|
|
714
709
|
group: {
|
|
715
710
|
label: defineMessage({
|
|
716
711
|
id: "oPjl8f",
|
|
717
|
-
defaultMessage:
|
|
718
|
-
"type": 0,
|
|
719
|
-
"value": "Urbania"
|
|
720
|
-
}]
|
|
712
|
+
defaultMessage: "Urbania"
|
|
721
713
|
}),
|
|
722
714
|
order: 10
|
|
723
715
|
},
|
|
724
716
|
title: defineMessage({
|
|
725
717
|
id: "sUP5BO",
|
|
726
|
-
defaultMessage:
|
|
727
|
-
"type": 0,
|
|
728
|
-
"value": "Urbania recommendation"
|
|
729
|
-
}]
|
|
718
|
+
defaultMessage: "Urbania recommendation"
|
|
730
719
|
}),
|
|
731
720
|
component: UrbaniaRecommendation,
|
|
732
721
|
layouts: ['top', 'bottom'],
|
|
@@ -735,20 +724,14 @@ var definition = [{
|
|
|
735
724
|
type: 'screen-layout',
|
|
736
725
|
label: defineMessage({
|
|
737
726
|
id: "4iBXj2",
|
|
738
|
-
defaultMessage:
|
|
739
|
-
"type": 0,
|
|
740
|
-
"value": "Layout"
|
|
741
|
-
}]
|
|
727
|
+
defaultMessage: "Layout"
|
|
742
728
|
})
|
|
743
729
|
}, {
|
|
744
730
|
name: 'sponsor',
|
|
745
731
|
type: 'text-element',
|
|
746
732
|
label: defineMessage({
|
|
747
733
|
id: "WY14Zu",
|
|
748
|
-
defaultMessage:
|
|
749
|
-
"type": 0,
|
|
750
|
-
"value": "Sponsor"
|
|
751
|
-
}]
|
|
734
|
+
defaultMessage: "Sponsor"
|
|
752
735
|
})
|
|
753
736
|
}, {
|
|
754
737
|
name: 'visual',
|
|
@@ -756,20 +739,14 @@ var definition = [{
|
|
|
756
739
|
isList: true,
|
|
757
740
|
label: defineMessage({
|
|
758
741
|
id: "HwqzVR",
|
|
759
|
-
defaultMessage:
|
|
760
|
-
"type": 0,
|
|
761
|
-
"value": "Visual"
|
|
762
|
-
}]
|
|
742
|
+
defaultMessage: "Visual"
|
|
763
743
|
}),
|
|
764
744
|
fields: [{
|
|
765
745
|
name: 'image',
|
|
766
746
|
type: 'visual',
|
|
767
747
|
label: defineMessage({
|
|
768
748
|
id: "xT/onn",
|
|
769
|
-
defaultMessage:
|
|
770
|
-
"type": 0,
|
|
771
|
-
"value": "Image"
|
|
772
|
-
}]
|
|
749
|
+
defaultMessage: "Image"
|
|
773
750
|
})
|
|
774
751
|
}]
|
|
775
752
|
}, {
|
|
@@ -777,60 +754,42 @@ var definition = [{
|
|
|
777
754
|
type: 'heading-element',
|
|
778
755
|
label: defineMessage({
|
|
779
756
|
id: "4grcMU",
|
|
780
|
-
defaultMessage:
|
|
781
|
-
"type": 0,
|
|
782
|
-
"value": "Category"
|
|
783
|
-
}]
|
|
757
|
+
defaultMessage: "Category"
|
|
784
758
|
})
|
|
785
759
|
}, {
|
|
786
760
|
name: 'title',
|
|
787
761
|
type: 'heading-element',
|
|
788
762
|
label: defineMessage({
|
|
789
763
|
id: "N25iDO",
|
|
790
|
-
defaultMessage:
|
|
791
|
-
"type": 0,
|
|
792
|
-
"value": "Title"
|
|
793
|
-
}]
|
|
764
|
+
defaultMessage: "Title"
|
|
794
765
|
})
|
|
795
766
|
}, {
|
|
796
767
|
name: 'date',
|
|
797
768
|
type: 'text-element',
|
|
798
769
|
label: defineMessage({
|
|
799
770
|
id: "yEG9zh",
|
|
800
|
-
defaultMessage:
|
|
801
|
-
"type": 0,
|
|
802
|
-
"value": "Date"
|
|
803
|
-
}]
|
|
771
|
+
defaultMessage: "Date"
|
|
804
772
|
})
|
|
805
773
|
}, {
|
|
806
774
|
name: 'location',
|
|
807
775
|
type: 'text-element',
|
|
808
776
|
label: defineMessage({
|
|
809
777
|
id: "zLxBdl",
|
|
810
|
-
defaultMessage:
|
|
811
|
-
"type": 0,
|
|
812
|
-
"value": "Location"
|
|
813
|
-
}]
|
|
778
|
+
defaultMessage: "Location"
|
|
814
779
|
})
|
|
815
780
|
}, {
|
|
816
781
|
name: 'description',
|
|
817
782
|
type: 'text-element',
|
|
818
783
|
label: defineMessage({
|
|
819
784
|
id: "Y7bs1v",
|
|
820
|
-
defaultMessage:
|
|
821
|
-
"type": 0,
|
|
822
|
-
"value": "Description"
|
|
823
|
-
}]
|
|
785
|
+
defaultMessage: "Description"
|
|
824
786
|
})
|
|
825
787
|
}, {
|
|
826
788
|
name: 'background',
|
|
827
789
|
type: 'background-recommendation',
|
|
828
790
|
label: defineMessage({
|
|
829
791
|
id: "+MPZRu",
|
|
830
|
-
defaultMessage:
|
|
831
|
-
"type": 0,
|
|
832
|
-
"value": "Background"
|
|
833
|
-
}]
|
|
792
|
+
defaultMessage: "Background"
|
|
834
793
|
})
|
|
835
794
|
}, {
|
|
836
795
|
id: 'recommendation',
|
|
@@ -838,30 +797,21 @@ var definition = [{
|
|
|
838
797
|
isList: true,
|
|
839
798
|
label: defineMessage({
|
|
840
799
|
id: "hPXJzA",
|
|
841
|
-
defaultMessage:
|
|
842
|
-
"type": 0,
|
|
843
|
-
"value": "Box params"
|
|
844
|
-
}]
|
|
800
|
+
defaultMessage: "Box params"
|
|
845
801
|
}),
|
|
846
802
|
fields: [{
|
|
847
803
|
name: 'cardBoxStyle',
|
|
848
804
|
type: 'box-style-form',
|
|
849
805
|
label: defineMessage({
|
|
850
806
|
id: "1yNxAl",
|
|
851
|
-
defaultMessage:
|
|
852
|
-
"type": 0,
|
|
853
|
-
"value": "Card box style"
|
|
854
|
-
}]
|
|
807
|
+
defaultMessage: "Card box style"
|
|
855
808
|
})
|
|
856
809
|
}, {
|
|
857
810
|
name: 'lineColor',
|
|
858
811
|
type: 'color',
|
|
859
812
|
label: defineMessage({
|
|
860
813
|
id: "Jti6I6",
|
|
861
|
-
defaultMessage:
|
|
862
|
-
"type": 0,
|
|
863
|
-
"value": "Lines color"
|
|
864
|
-
}]
|
|
814
|
+
defaultMessage: "Lines color"
|
|
865
815
|
})
|
|
866
816
|
}, {
|
|
867
817
|
name: 'withoutZoom',
|
|
@@ -869,10 +819,7 @@ var definition = [{
|
|
|
869
819
|
defaultValue: false,
|
|
870
820
|
label: defineMessage({
|
|
871
821
|
id: "ehuj8A",
|
|
872
|
-
defaultMessage:
|
|
873
|
-
"type": 0,
|
|
874
|
-
"value": "Without image zoom"
|
|
875
|
-
}]
|
|
822
|
+
defaultMessage: "Without image zoom"
|
|
876
823
|
})
|
|
877
824
|
}]
|
|
878
825
|
}, {
|
|
@@ -880,10 +827,7 @@ var definition = [{
|
|
|
880
827
|
type: 'header',
|
|
881
828
|
label: defineMessage({
|
|
882
829
|
id: "rhuDxI",
|
|
883
|
-
defaultMessage:
|
|
884
|
-
"type": 0,
|
|
885
|
-
"value": "Header"
|
|
886
|
-
}]
|
|
830
|
+
defaultMessage: "Header"
|
|
887
831
|
}),
|
|
888
832
|
theme: {
|
|
889
833
|
badge: {
|
|
@@ -898,10 +842,7 @@ var definition = [{
|
|
|
898
842
|
type: 'footer',
|
|
899
843
|
label: defineMessage({
|
|
900
844
|
id: "g4nybp",
|
|
901
|
-
defaultMessage:
|
|
902
|
-
"type": 0,
|
|
903
|
-
"value": "Footer"
|
|
904
|
-
}]
|
|
845
|
+
defaultMessage: "Footer"
|
|
905
846
|
}),
|
|
906
847
|
theme: {
|
|
907
848
|
callToAction: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-urbania-recommendation",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.74",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
38
|
"types": "./es/index.d.ts",
|
|
39
|
+
"style": "./assets/css/styles.css",
|
|
39
40
|
"import": "./es/index.js"
|
|
40
41
|
},
|
|
41
42
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -52,27 +53,27 @@
|
|
|
52
53
|
"build": "../../scripts/prepare-package.sh --types"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"react": "^
|
|
60
|
-
"react-dom": "^
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-background": "^0.4.
|
|
66
|
-
"@micromag/element-button": "^0.4.
|
|
67
|
-
"@micromag/element-container": "^0.4.
|
|
68
|
-
"@micromag/element-footer": "^0.4.
|
|
69
|
-
"@micromag/element-header": "^0.4.
|
|
70
|
-
"@micromag/element-heading": "^0.4.
|
|
71
|
-
"@micromag/element-layout": "^0.4.
|
|
72
|
-
"@micromag/element-scroll": "^0.4.
|
|
73
|
-
"@micromag/element-text": "^0.4.
|
|
74
|
-
"@micromag/element-visual": "^0.4.
|
|
75
|
-
"@micromag/transforms": "^0.4.
|
|
65
|
+
"@micromag/core": "^0.4.74",
|
|
66
|
+
"@micromag/element-background": "^0.4.74",
|
|
67
|
+
"@micromag/element-button": "^0.4.74",
|
|
68
|
+
"@micromag/element-container": "^0.4.74",
|
|
69
|
+
"@micromag/element-footer": "^0.4.74",
|
|
70
|
+
"@micromag/element-header": "^0.4.74",
|
|
71
|
+
"@micromag/element-heading": "^0.4.74",
|
|
72
|
+
"@micromag/element-layout": "^0.4.74",
|
|
73
|
+
"@micromag/element-scroll": "^0.4.74",
|
|
74
|
+
"@micromag/element-text": "^0.4.74",
|
|
75
|
+
"@micromag/element-visual": "^0.4.74",
|
|
76
|
+
"@micromag/transforms": "^0.4.74",
|
|
76
77
|
"classnames": "^2.2.6",
|
|
77
78
|
"lodash": "^4.17.23",
|
|
78
79
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -82,6 +83,6 @@
|
|
|
82
83
|
"access": "public",
|
|
83
84
|
"registry": "https://registry.npmjs.org/"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
|
|
86
87
|
"types": "es/index.d.ts"
|
|
87
88
|
}
|