@micromag/screen-image-360 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.
Files changed (3) hide show
  1. package/es/index.d.ts +4 -2
  2. package/es/index.js +674 -420
  3. package/package.json +16 -15
package/es/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ImageMedia, BackgroundElement, Header, Footer } from '@micromag/core';
2
+ import { ForwardedRef } from 'react';
3
+ import { ImageMedia, BackgroundElement, Header, Footer, MediaElement } from '@micromag/core';
3
4
 
4
5
  interface Image360ScreenProps {
5
6
  layout?: 'full';
@@ -11,9 +12,10 @@ interface Image360ScreenProps {
11
12
  preload?: boolean;
12
13
  type?: string | null;
13
14
  spacing?: number;
15
+ mediaRef?: ForwardedRef<MediaElement> | null;
14
16
  className?: string | null;
15
17
  }
16
- declare function Image360Screen({ layout: _layout, image, background, header, footer, current, preload, type, spacing, className, }: Image360ScreenProps): react_jsx_runtime.JSX.Element;
18
+ declare function Image360Screen({ layout: _layout, image, background, header, footer, current, preload, type, spacing, mediaRef: customMediaRef, className, }: Image360ScreenProps): react_jsx_runtime.JSX.Element;
17
19
 
18
20
  declare const _default: {
19
21
  id: string;
package/es/index.js CHANGED
@@ -1,68 +1,66 @@
1
1
  import { FormattedMessage, defineMessage } from 'react-intl';
2
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import { c } from 'react/compiler-runtime';
5
3
  import { getSizeWithinBounds } from '@folklore/size';
6
4
  import classNames from 'classnames';
7
- import { useState, useEffect, useRef, useCallback } from 'react';
8
- import { ScreenElement, PlaceholderVideo360 } from '@micromag/core/components';
5
+ import { useState, useEffect, useRef } from 'react';
6
+ import { PlaceholderVideo360, ScreenElement } from '@micromag/core/components';
9
7
  import { useScreenRenderContext, useScreenSize, useViewerNavigation, useViewerWebView, useViewerContext, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
10
8
  import { useTrackScreenEvent, useDevicePixelRatio, useAnimationFrame } from '@micromag/core/hooks';
11
- import { isHeaderFilled, isFooterFilled, getFooterProps } from '@micromag/core/utils';
9
+ import { isHeaderFilled, isFooterFilled, getFooterProps, mergeRefs } from '@micromag/core/utils';
12
10
  import Background from '@micromag/element-background';
13
11
  import Container from '@micromag/element-container';
14
12
  import Footer from '@micromag/element-footer';
15
13
  import Header from '@micromag/element-header';
16
14
  import Image from '@micromag/element-image';
17
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
15
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
18
16
 
19
17
  /**
20
18
  * Locale loader
21
19
  */
22
- var packageCache = null;
23
- var useThree = function useThree() {
20
+ let packageCache = null;
21
+ const useThree = () => {
24
22
  // transport
25
- var _useState = useState({
26
- "package": packageCache
27
- }),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- loadedPackage = _useState2[0]["package"],
30
- setLoadedPackage = _useState2[1];
31
- useEffect(function () {
32
- var canceled = false;
23
+ const [{
24
+ package: loadedPackage
25
+ }, setLoadedPackage] = useState({
26
+ package: packageCache
27
+ });
28
+ useEffect(() => {
29
+ let canceled = false;
33
30
  if (loadedPackage !== null) {
34
- return function () {
31
+ return () => {
35
32
  canceled = true;
36
33
  };
37
34
  }
38
- import('three').then(function (_ref) {
39
- var Scene = _ref.Scene,
40
- PerspectiveCamera = _ref.PerspectiveCamera,
41
- SphereBufferGeometry = _ref.SphereBufferGeometry,
42
- VideoTexture = _ref.VideoTexture,
43
- TextureLoader = _ref.TextureLoader,
44
- MeshBasicMaterial = _ref.MeshBasicMaterial,
45
- Mesh = _ref.Mesh,
46
- WebGLRenderer = _ref.WebGLRenderer,
47
- MathUtils = _ref.MathUtils;
35
+ import('three').then(({
36
+ Scene,
37
+ PerspectiveCamera,
38
+ SphereBufferGeometry,
39
+ VideoTexture,
40
+ TextureLoader,
41
+ MeshBasicMaterial,
42
+ Mesh,
43
+ WebGLRenderer,
44
+ MathUtils
45
+ }) => {
48
46
  packageCache = {
49
- Scene: Scene,
50
- PerspectiveCamera: PerspectiveCamera,
51
- SphereBufferGeometry: SphereBufferGeometry,
52
- VideoTexture: VideoTexture,
53
- TextureLoader: TextureLoader,
54
- MeshBasicMaterial: MeshBasicMaterial,
55
- Mesh: Mesh,
56
- WebGLRenderer: WebGLRenderer,
57
- MathUtils: MathUtils
47
+ Scene,
48
+ PerspectiveCamera,
49
+ SphereBufferGeometry,
50
+ VideoTexture,
51
+ TextureLoader,
52
+ MeshBasicMaterial,
53
+ Mesh,
54
+ WebGLRenderer,
55
+ MathUtils
58
56
  };
59
57
  if (!canceled) {
60
58
  setLoadedPackage({
61
- "package": packageCache
59
+ package: packageCache
62
60
  });
63
61
  }
64
62
  });
65
- return function () {
63
+ return () => {
66
64
  canceled = true;
67
65
  };
68
66
  }, [loadedPackage, setLoadedPackage]);
@@ -71,374 +69,618 @@ var useThree = function useThree() {
71
69
 
72
70
  var styles = {"container":"micromag-screen-image-360-container","background":"micromag-screen-image-360-background","content":"micromag-screen-image-360-content","empty":"micromag-screen-image-360-empty","inner":"micromag-screen-image-360-inner","canvas":"micromag-screen-image-360-canvas","canvasButton":"micromag-screen-image-360-canvasButton","video":"micromag-screen-image-360-video","videoContainer":"micromag-screen-image-360-videoContainer","placeholder":"micromag-screen-image-360-placeholder","header":"micromag-screen-image-360-header","footer":"micromag-screen-image-360-footer","showVideo":"micromag-screen-image-360-showVideo"};
73
71
 
74
- function Image360Screen(_ref) {
75
- _ref.layout;
76
- var _ref$image = _ref.image,
77
- image = _ref$image === void 0 ? null : _ref$image,
78
- _ref$background = _ref.background,
79
- background = _ref$background === void 0 ? null : _ref$background,
80
- _ref$header = _ref.header,
81
- header = _ref$header === void 0 ? null : _ref$header,
82
- _ref$footer = _ref.footer,
83
- footer = _ref$footer === void 0 ? null : _ref$footer,
84
- _ref$current = _ref.current,
85
- current = _ref$current === void 0 ? true : _ref$current,
86
- _ref$preload = _ref.preload,
87
- preload = _ref$preload === void 0 ? true : _ref$preload,
88
- _ref$type = _ref.type,
89
- type = _ref$type === void 0 ? null : _ref$type,
90
- _ref$spacing = _ref.spacing,
91
- spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
92
- _ref$className = _ref.className,
93
- className = _ref$className === void 0 ? null : _ref$className;
94
- var THREE = useThree();
95
- var trackScreenEvent = useTrackScreenEvent(type);
96
- var _useScreenRenderConte = useScreenRenderContext(),
97
- isView = _useScreenRenderConte.isView,
98
- isPreview = _useScreenRenderConte.isPreview,
99
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
100
- isEdit = _useScreenRenderConte.isEdit,
101
- isStatic = _useScreenRenderConte.isStatic,
102
- isCapture = _useScreenRenderConte.isCapture;
103
- var _useScreenSize = useScreenSize(),
104
- width = _useScreenSize.width,
105
- height = _useScreenSize.height,
106
- landscape = _useScreenSize.landscape,
107
- resolution = _useScreenSize.resolution;
108
- var _useViewerNavigation = useViewerNavigation(),
109
- gotoPreviousScreen = _useViewerNavigation.gotoPreviousScreen,
110
- gotoNextScreen = _useViewerNavigation.gotoNextScreen;
111
- var _useViewerWebView = useViewerWebView(),
112
- openWebView = _useViewerWebView.open;
113
- var _useViewerContext = useViewerContext(),
114
- viewerBottomHeight = _useViewerContext.bottomHeight,
115
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
116
- var _usePlaybackContext = usePlaybackContext(),
117
- muted = _usePlaybackContext.muted;
118
- var _usePlaybackMediaRef = usePlaybackMediaRef(current, true),
119
- mediaRef = _usePlaybackMediaRef.ref,
120
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
121
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
122
- var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
123
- var mediaShouldLoad = current || preload;
124
- var canvasContainerRef = useRef();
125
- var devicePixelRatio = useDevicePixelRatio();
126
-
127
- // ------------------------------------
128
-
129
- var hasMedia = image !== null;
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
72
+ function Image360Screen(t0) {
73
+ const $ = c(119);
74
+ const {
75
+ layout: t1,
76
+ image: t2,
77
+ background: t3,
78
+ header: t4,
79
+ footer: t5,
80
+ current: t6,
81
+ preload: t7,
82
+ type: t8,
83
+ spacing: t9,
84
+ mediaRef: t10,
85
+ className: t11
86
+ } = t0;
87
+ const image = t2 === undefined ? null : t2;
88
+ const background = t3 === undefined ? null : t3;
89
+ const header = t4 === undefined ? null : t4;
90
+ const footer = t5 === undefined ? null : t5;
91
+ const current = t6 === undefined ? true : t6;
92
+ const preload = t7 === undefined ? true : t7;
93
+ const type = t8 === undefined ? null : t8;
94
+ const spacing = t9 === undefined ? 20 : t9;
95
+ const customMediaRef = t10 === undefined ? null : t10;
96
+ const className = t11 === undefined ? null : t11;
97
+ const THREE = useThree();
98
+ const trackScreenEvent = useTrackScreenEvent(type);
99
+ const {
100
+ isView,
101
+ isPreview,
102
+ isPlaceholder,
103
+ isEdit,
104
+ isStatic,
105
+ isCapture
106
+ } = useScreenRenderContext();
107
+ const {
108
+ width,
109
+ height,
110
+ landscape,
111
+ resolution
112
+ } = useScreenSize();
113
+ const {
114
+ gotoPreviousScreen,
115
+ gotoNextScreen
116
+ } = useViewerNavigation();
117
+ const {
118
+ open: openWebView
119
+ } = useViewerWebView();
120
+ const {
121
+ bottomHeight: viewerBottomHeight,
122
+ bottomSidesWidth: viewerBottomSidesWidth
123
+ } = useViewerContext();
124
+ const {
125
+ muted
126
+ } = usePlaybackContext();
127
+ const {
128
+ ref: mediaRef,
129
+ isCurrent: t12
130
+ } = usePlaybackMediaRef(current, true);
131
+ const isCurrentMedia = t12 === undefined ? false : t12;
132
+ const backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
133
+ const mediaShouldLoad = current || preload;
134
+ const canvasContainerRef = useRef();
135
+ const devicePixelRatio = useDevicePixelRatio();
136
+ const hasMedia = image !== null;
137
+ let t13;
138
+ if ($[0] !== header) {
139
+ t13 = isHeaderFilled(header);
140
+ $[0] = header;
141
+ $[1] = t13;
142
+ } else {
143
+ t13 = $[1];
144
+ }
145
+ const hasHeader = t13;
146
+ let t14;
147
+ if ($[2] !== footer) {
148
+ t14 = isFooterFilled(footer);
149
+ $[2] = footer;
150
+ $[3] = t14;
151
+ } else {
152
+ t14 = $[3];
153
+ }
154
+ const hasFooter = t14;
155
+ let t15;
156
+ if ($[4] !== current || $[5] !== footer || $[6] !== isPreview || $[7] !== isView || $[8] !== openWebView) {
157
+ t15 = getFooterProps(footer, {
158
+ isView,
159
+ current,
160
+ openWebView,
161
+ isPreview
162
+ });
163
+ $[4] = current;
164
+ $[5] = footer;
165
+ $[6] = isPreview;
166
+ $[7] = isView;
167
+ $[8] = openWebView;
168
+ $[9] = t15;
169
+ } else {
170
+ t15 = $[9];
171
+ }
172
+ const footerProps = t15;
173
+ const [ready, setReady] = useState(!hasMedia);
174
+ const {
175
+ metadata: t16,
176
+ url: t17,
177
+ thumbnail_url: t18
178
+ } = image || {};
179
+ const imageMetadata = t16 === undefined ? null : t16;
180
+ const imageUrl = t17 === undefined ? null : t17;
181
+ const thumbnailUrl = t18 === undefined ? null : t18;
182
+ const hasMediaUrl = imageUrl !== null;
183
+ const {
184
+ width: t19,
185
+ height: t20
186
+ } = imageMetadata || {};
187
+ const imageWidth = t19 === undefined ? 0 : t19;
188
+ const imageHeight = t20 === undefined ? 0 : t20;
189
+ const hasThumbnail = thumbnailUrl !== null;
190
+ const [posterReady, setPosterReady] = useState(!hasThumbnail);
191
+ const withSphere = hasMediaUrl && (isView || isEdit) && !isCapture && !isStatic;
192
+ const {
193
+ width: resizedImageWidth,
194
+ height: resizedImageHeight
195
+ } = getSizeWithinBounds(imageWidth, imageHeight, width, height, {
196
+ cover: true
137
197
  });
138
- var _useState = useState(!hasMedia),
139
- _useState2 = _slicedToArray(_useState, 2),
140
- ready = _useState2[0],
141
- setReady = _useState2[1];
142
- var _ref2 = image || {},
143
- _ref2$metadata = _ref2.metadata,
144
- imageMetadata = _ref2$metadata === void 0 ? null : _ref2$metadata,
145
- _ref2$url = _ref2.url,
146
- imageUrl = _ref2$url === void 0 ? null : _ref2$url,
147
- _ref2$thumbnail_url = _ref2.thumbnail_url,
148
- thumbnailUrl = _ref2$thumbnail_url === void 0 ? null : _ref2$thumbnail_url;
149
- var hasMediaUrl = imageUrl !== null;
150
- var _ref3 = imageMetadata || {},
151
- _ref3$width = _ref3.width,
152
- imageWidth = _ref3$width === void 0 ? 0 : _ref3$width,
153
- _ref3$height = _ref3.height,
154
- imageHeight = _ref3$height === void 0 ? 0 : _ref3$height;
155
- var hasThumbnail = thumbnailUrl !== null;
156
- var _useState3 = useState(!hasThumbnail),
157
- _useState4 = _slicedToArray(_useState3, 2),
158
- posterReady = _useState4[0],
159
- setPosterReady = _useState4[1];
160
- var withSphere = hasMediaUrl && (isView || isEdit) && !isCapture && !isStatic;
161
- var _getSizeWithinBounds = getSizeWithinBounds(imageWidth, imageHeight, width, height, {
162
- cover: true
163
- }),
164
- resizedImageWidth = _getSizeWithinBounds.width,
165
- resizedImageHeight = _getSizeWithinBounds.height;
166
- var resizedImageLeft = -(resizedImageWidth - width) / 2;
167
- var resizedImageTop = -(resizedImageHeight - height) / 2;
168
- useEffect(function () {
169
- setReady(!hasMediaUrl);
170
- }, [imageUrl, hasMediaUrl, setReady]);
171
- useEffect(function () {
172
- setPosterReady(!hasThumbnail);
173
- }, [thumbnailUrl, hasThumbnail, setPosterReady]);
174
-
175
- // 3D layer --------------------------
176
-
177
- var canvasRef = useRef(null);
178
- var camera = useRef(null);
179
- var scene = useRef(null);
180
- var renderer = useRef(null);
181
- var lon = useRef(0);
182
- var lat = useRef(0);
183
- var phi = useRef(0);
184
- var theta = useRef(0);
185
- // const distance = useRef(50);
186
- var pointerDown = useRef(false);
187
- var pointerDownX = useRef(0);
188
- var pointerDownY = useRef(0);
189
- var pointerLon = useRef(0);
190
- var pointerLat = useRef(0);
191
-
192
- // render 3D frame
193
-
194
- var render3D = useCallback(function () {
195
- if (THREE === null) {
196
- return;
197
- }
198
-
199
- // const { MathUtils } = THREE;
200
- // lat.current = Math.max(-85, Math.min(85, lat.current));
201
- // phi.current = MathUtils.degToRad(90 - lat.current);
202
- // theta.current = MathUtils.degToRad(lon.current);
203
-
204
- // camera.current.position.x =
205
- // distance.current * Math.sin(phi.current) * Math.cos(theta.current);
206
- // camera.current.position.y = distance.current * Math.cos(phi.current);
207
- // camera.current.position.z =
208
- // distance.current * Math.sin(phi.current) * Math.sin(theta.current);
209
-
210
- // camera.current.lookAt(0, 0, 0);
211
-
212
- lat.current = Math.max(-85, Math.min(85, lat.current));
213
- phi.current = THREE.MathUtils.degToRad(90 - lat.current);
214
- theta.current = THREE.MathUtils.degToRad(lon.current);
215
- var x = 500 * Math.sin(phi.current) * Math.cos(theta.current);
216
- var y = 500 * Math.cos(phi.current);
217
- var z = 500 * Math.sin(phi.current) * Math.sin(theta.current);
218
- camera.current.lookAt(x, y, z);
219
- renderer.current.render(scene.current, camera.current);
220
- }, [THREE]);
221
-
222
- // Init 3D layer
223
-
224
- useEffect(function () {
225
- if (THREE !== null && hasMediaUrl && withSphere) {
226
- var Scene = THREE.Scene,
227
- PerspectiveCamera = THREE.PerspectiveCamera,
228
- SphereBufferGeometry = THREE.SphereBufferGeometry,
229
- MeshBasicMaterial = THREE.MeshBasicMaterial,
230
- Mesh = THREE.Mesh,
231
- WebGLRenderer = THREE.WebGLRenderer,
232
- TextureLoader = THREE.TextureLoader;
233
- var _canvasRef$current = canvasRef.current,
234
- canvasWidth = _canvasRef$current.offsetWidth,
235
- canvasHeight = _canvasRef$current.offsetHeight;
236
- camera.current = new PerspectiveCamera(50, canvasWidth / canvasHeight, 1, 1100);
237
- scene.current = new Scene();
238
- var geometry = new SphereBufferGeometry(500, 60, 40, 0, Math.PI * 2, Math.PI / 3, Math.PI / 3);
239
- geometry.scale(-1, 1, 1);
240
- var texture = new TextureLoader().load(imageUrl);
241
- var material = new MeshBasicMaterial({
242
- map: texture
243
- });
244
- var mesh = new Mesh(geometry, material);
245
- scene.current.add(mesh);
246
- renderer.current = new WebGLRenderer({
247
- canvas: canvasRef.current
248
- });
249
- renderer.current.setPixelRatio(devicePixelRatio);
250
- renderer.current.setSize(canvasWidth, canvasHeight);
251
- render3D();
252
- }
253
- return function () {
254
- if (withSphere) {
255
- camera.current = null;
256
- scene.current = null;
257
- renderer.current = null;
198
+ const resizedImageLeft = -(resizedImageWidth - width) / 2;
199
+ const resizedImageTop = -(resizedImageHeight - height) / 2;
200
+ let t21;
201
+ if ($[10] !== hasMediaUrl) {
202
+ t21 = () => {
203
+ setReady(!hasMediaUrl);
204
+ };
205
+ $[10] = hasMediaUrl;
206
+ $[11] = t21;
207
+ } else {
208
+ t21 = $[11];
209
+ }
210
+ let t22;
211
+ if ($[12] !== hasMediaUrl || $[13] !== imageUrl) {
212
+ t22 = [imageUrl, hasMediaUrl, setReady];
213
+ $[12] = hasMediaUrl;
214
+ $[13] = imageUrl;
215
+ $[14] = t22;
216
+ } else {
217
+ t22 = $[14];
218
+ }
219
+ useEffect(t21, t22);
220
+ let t23;
221
+ if ($[15] !== hasThumbnail || $[16] !== setPosterReady) {
222
+ t23 = () => {
223
+ setPosterReady(!hasThumbnail);
224
+ };
225
+ $[15] = hasThumbnail;
226
+ $[16] = setPosterReady;
227
+ $[17] = t23;
228
+ } else {
229
+ t23 = $[17];
230
+ }
231
+ let t24;
232
+ if ($[18] !== hasThumbnail || $[19] !== setPosterReady || $[20] !== thumbnailUrl) {
233
+ t24 = [thumbnailUrl, hasThumbnail, setPosterReady];
234
+ $[18] = hasThumbnail;
235
+ $[19] = setPosterReady;
236
+ $[20] = thumbnailUrl;
237
+ $[21] = t24;
238
+ } else {
239
+ t24 = $[21];
240
+ }
241
+ useEffect(t23, t24);
242
+ const canvasRef = useRef(null);
243
+ const camera = useRef(null);
244
+ const scene = useRef(null);
245
+ const renderer = useRef(null);
246
+ const lon = useRef(0);
247
+ const lat = useRef(0);
248
+ const phi = useRef(0);
249
+ const theta = useRef(0);
250
+ const pointerDown = useRef(false);
251
+ const pointerDownX = useRef(0);
252
+ const pointerDownY = useRef(0);
253
+ const pointerLon = useRef(0);
254
+ const pointerLat = useRef(0);
255
+ let t25;
256
+ if ($[22] !== THREE) {
257
+ t25 = () => {
258
+ if (THREE === null) {
259
+ return;
258
260
  }
261
+ lat.current = Math.max(-85, Math.min(85, lat.current));
262
+ phi.current = THREE.MathUtils.degToRad(90 - lat.current);
263
+ theta.current = THREE.MathUtils.degToRad(lon.current);
264
+ const x = 500 * Math.sin(phi.current) * Math.cos(theta.current);
265
+ const y = 500 * Math.cos(phi.current);
266
+ const z = 500 * Math.sin(phi.current) * Math.sin(theta.current);
267
+ camera.current.lookAt(x, y, z);
268
+ renderer.current.render(scene.current, camera.current);
259
269
  };
260
- }, [hasMediaUrl, withSphere, render3D, THREE]);
261
- useAnimationFrame(render3D, {
262
- disabled: !withSphere || THREE === null
263
- });
264
-
265
- // Resize 3D layer
266
-
267
- useEffect(function () {
268
- if (camera.current !== null && renderer.current !== null) {
269
- camera.current.aspect = width / height;
270
- camera.current.updateProjectionMatrix();
271
- renderer.current.setSize(width, height);
272
- }
273
- }, [width, height]);
274
-
275
- // Pointer interaction
276
- var togglePlayTimeout = useRef(null);
277
- var onPointerDown = useCallback(function (e) {
278
- pointerDown.current = true;
279
- pointerDownX.current = e.clientX;
280
- pointerDownY.current = e.clientY;
281
- pointerLon.current = lon.current;
282
- pointerLat.current = lat.current;
283
- }, []);
284
- var pixelsMoved = useRef(0);
285
- var lastPointerClient = useRef(null);
286
- var pixelsMovedTracked = useRef(false);
287
- var onPointerMove = useCallback(function (e) {
288
- if (pointerDown.current) {
289
- var _ref4 = e || {},
290
- _ref4$clientX = _ref4.clientX,
291
- clientX = _ref4$clientX === void 0 ? null : _ref4$clientX,
292
- _ref4$clientY = _ref4.clientY,
293
- clientY = _ref4$clientY === void 0 ? null : _ref4$clientY;
294
- var downDeltaX = pointerDownX.current - clientX;
295
- var downDeltaY = pointerDownY.current - clientY;
296
- lon.current = downDeltaX * 0.2 + pointerLon.current;
297
- lat.current = downDeltaY * 0.2 + pointerLat.current;
298
- var _ref5 = lastPointerClient.current || {},
299
- _ref5$x = _ref5.x,
300
- lastX = _ref5$x === void 0 ? clientX : _ref5$x,
301
- _ref5$y = _ref5.y,
302
- lastY = _ref5$y === void 0 ? clientY : _ref5$y;
303
- var deltaX = Math.abs(lastX - clientX) || 0;
304
- var deltaY = Math.abs(lastY - clientY) || 0;
305
- pixelsMoved.current += deltaX + deltaY;
306
- if (!pixelsMovedTracked.current && pixelsMoved.current > Math.min(width, height)) {
307
- trackScreenEvent('drag_sphere');
308
- pixelsMovedTracked.current = true;
270
+ $[22] = THREE;
271
+ $[23] = t25;
272
+ } else {
273
+ t25 = $[23];
274
+ }
275
+ const render3D = t25;
276
+ let t26;
277
+ if ($[24] !== THREE || $[25] !== devicePixelRatio || $[26] !== hasMediaUrl || $[27] !== imageUrl || $[28] !== render3D || $[29] !== withSphere) {
278
+ t26 = () => {
279
+ if (THREE !== null && hasMediaUrl && withSphere) {
280
+ const {
281
+ Scene,
282
+ PerspectiveCamera,
283
+ SphereBufferGeometry,
284
+ MeshBasicMaterial,
285
+ Mesh,
286
+ WebGLRenderer,
287
+ TextureLoader
288
+ } = THREE;
289
+ const {
290
+ offsetWidth: canvasWidth,
291
+ offsetHeight: canvasHeight
292
+ } = canvasRef.current;
293
+ camera.current = new PerspectiveCamera(50, canvasWidth / canvasHeight, 1, 1100);
294
+ scene.current = new Scene();
295
+ const geometry = new SphereBufferGeometry(500, 60, 40, 0, Math.PI * 2, Math.PI / 3, Math.PI / 3);
296
+ geometry.scale(-1, 1, 1);
297
+ const texture = new TextureLoader().load(imageUrl);
298
+ const material = new MeshBasicMaterial({
299
+ map: texture
300
+ });
301
+ const mesh = new Mesh(geometry, material);
302
+ scene.current.add(mesh);
303
+ renderer.current = new WebGLRenderer({
304
+ canvas: canvasRef.current
305
+ });
306
+ renderer.current.setPixelRatio(devicePixelRatio);
307
+ renderer.current.setSize(canvasWidth, canvasHeight);
308
+ render3D();
309
309
  }
310
- lastPointerClient.current = {
311
- x: clientX,
312
- y: clientY
310
+ return () => {
311
+ if (withSphere) {
312
+ camera.current = null;
313
+ scene.current = null;
314
+ renderer.current = null;
315
+ }
313
316
  };
314
- if (Math.abs(downDeltaX) > 3 || Math.abs(downDeltaY) > 3) {
315
- if (togglePlayTimeout.current !== null) {
316
- clearTimeout(togglePlayTimeout.current);
317
- togglePlayTimeout.current = null;
317
+ };
318
+ $[24] = THREE;
319
+ $[25] = devicePixelRatio;
320
+ $[26] = hasMediaUrl;
321
+ $[27] = imageUrl;
322
+ $[28] = render3D;
323
+ $[29] = withSphere;
324
+ $[30] = t26;
325
+ } else {
326
+ t26 = $[30];
327
+ }
328
+ let t27;
329
+ if ($[31] !== THREE || $[32] !== hasMediaUrl || $[33] !== render3D || $[34] !== withSphere) {
330
+ t27 = [hasMediaUrl, withSphere, render3D, THREE];
331
+ $[31] = THREE;
332
+ $[32] = hasMediaUrl;
333
+ $[33] = render3D;
334
+ $[34] = withSphere;
335
+ $[35] = t27;
336
+ } else {
337
+ t27 = $[35];
338
+ }
339
+ useEffect(t26, t27);
340
+ const t28 = !withSphere || THREE === null;
341
+ let t29;
342
+ if ($[36] !== t28) {
343
+ t29 = {
344
+ disabled: t28
345
+ };
346
+ $[36] = t28;
347
+ $[37] = t29;
348
+ } else {
349
+ t29 = $[37];
350
+ }
351
+ useAnimationFrame(render3D, t29);
352
+ let t30;
353
+ let t31;
354
+ if ($[38] !== height || $[39] !== width) {
355
+ t30 = () => {
356
+ if (camera.current !== null && renderer.current !== null) {
357
+ camera.current.aspect = width / height;
358
+ camera.current.updateProjectionMatrix();
359
+ renderer.current.setSize(width, height);
360
+ }
361
+ };
362
+ t31 = [width, height];
363
+ $[38] = height;
364
+ $[39] = width;
365
+ $[40] = t30;
366
+ $[41] = t31;
367
+ } else {
368
+ t30 = $[40];
369
+ t31 = $[41];
370
+ }
371
+ useEffect(t30, t31);
372
+ const togglePlayTimeout = useRef(null);
373
+ let t32;
374
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
375
+ t32 = e => {
376
+ pointerDown.current = true;
377
+ pointerDownX.current = e.clientX;
378
+ pointerDownY.current = e.clientY;
379
+ pointerLon.current = lon.current;
380
+ pointerLat.current = lat.current;
381
+ };
382
+ $[42] = t32;
383
+ } else {
384
+ t32 = $[42];
385
+ }
386
+ const onPointerDown = t32;
387
+ const pixelsMoved = useRef(0);
388
+ const lastPointerClient = useRef(null);
389
+ const pixelsMovedTracked = useRef(false);
390
+ let t33;
391
+ if ($[43] !== height || $[44] !== trackScreenEvent || $[45] !== width) {
392
+ t33 = e_0 => {
393
+ if (pointerDown.current) {
394
+ const {
395
+ clientX: t34,
396
+ clientY: t35
397
+ } = e_0 || {};
398
+ const clientX = t34 === undefined ? null : t34;
399
+ const clientY = t35 === undefined ? null : t35;
400
+ const downDeltaX = pointerDownX.current - clientX;
401
+ const downDeltaY = pointerDownY.current - clientY;
402
+ lon.current = downDeltaX * 0.2 + pointerLon.current;
403
+ lat.current = downDeltaY * 0.2 + pointerLat.current;
404
+ const {
405
+ x: t36,
406
+ y: t37
407
+ } = lastPointerClient.current || {};
408
+ const lastX = t36 === undefined ? clientX : t36;
409
+ const lastY = t37 === undefined ? clientY : t37;
410
+ const deltaX = Math.abs(lastX - clientX) || 0;
411
+ const deltaY = Math.abs(lastY - clientY) || 0;
412
+ pixelsMoved.current = pixelsMoved.current + (deltaX + deltaY);
413
+ if (!pixelsMovedTracked.current && pixelsMoved.current > Math.min(width, height)) {
414
+ trackScreenEvent("drag_sphere");
415
+ pixelsMovedTracked.current = true;
416
+ }
417
+ lastPointerClient.current = {
418
+ x: clientX,
419
+ y: clientY
420
+ };
421
+ if (Math.abs(downDeltaX) > 3 || Math.abs(downDeltaY) > 3) {
422
+ if (togglePlayTimeout.current !== null) {
423
+ clearTimeout(togglePlayTimeout.current);
424
+ togglePlayTimeout.current = null;
425
+ }
318
426
  }
319
427
  }
320
- }
321
- }, [width, height, trackScreenEvent]);
322
- var onPointerUp = useCallback(function (e) {
323
- var canvasContainer = canvasContainerRef.current;
324
- if (pointerDown.current && canvasContainer !== null) {
325
- var distX = Math.abs(pointerDownX.current - e.clientX);
326
- var distY = Math.abs(pointerDownY.current - e.clientY);
327
- var pixelsMovedTolerance = 3;
328
- var tapNextScreenWidthPercent = 0.5;
329
- var canTapToNavigate = !landscape && togglePlayTimeout.current !== null;
330
- var validNavigateTap = canTapToNavigate && distX < pixelsMovedTolerance && distY < pixelsMovedTolerance;
331
- if (validNavigateTap) {
332
- var _canvasContainer$getB = canvasContainer.getBoundingClientRect(),
333
- _canvasContainer$getB2 = _canvasContainer$getB.left,
334
- containerX = _canvasContainer$getB2 === void 0 ? 0 : _canvasContainer$getB2,
335
- containerWidth = _canvasContainer$getB.width;
336
- var hasTappedLeft = e.clientX - containerX < containerWidth * (1 - tapNextScreenWidthPercent);
337
- if (hasTappedLeft) {
338
- if (gotoPreviousScreen !== null) {
339
- gotoPreviousScreen();
428
+ };
429
+ $[43] = height;
430
+ $[44] = trackScreenEvent;
431
+ $[45] = width;
432
+ $[46] = t33;
433
+ } else {
434
+ t33 = $[46];
435
+ }
436
+ const onPointerMove = t33;
437
+ let t34;
438
+ if ($[47] !== gotoNextScreen || $[48] !== gotoPreviousScreen || $[49] !== landscape) {
439
+ t34 = e_1 => {
440
+ const canvasContainer = canvasContainerRef.current;
441
+ if (pointerDown.current && canvasContainer !== null) {
442
+ const distX = Math.abs(pointerDownX.current - e_1.clientX);
443
+ const distY = Math.abs(pointerDownY.current - e_1.clientY);
444
+ const canTapToNavigate = !landscape && togglePlayTimeout.current !== null;
445
+ const validNavigateTap = canTapToNavigate && distX < 3 && distY < 3;
446
+ if (validNavigateTap) {
447
+ const {
448
+ left: t35,
449
+ width: containerWidth
450
+ } = canvasContainer.getBoundingClientRect();
451
+ const containerX = t35 === undefined ? 0 : t35;
452
+ const hasTappedLeft = e_1.clientX - containerX < containerWidth * 0.5;
453
+ if (hasTappedLeft) {
454
+ if (gotoPreviousScreen !== null) {
455
+ gotoPreviousScreen();
456
+ }
457
+ } else {
458
+ if (gotoNextScreen !== null) {
459
+ gotoNextScreen();
460
+ }
340
461
  }
341
- } else if (gotoNextScreen !== null) {
342
- gotoNextScreen();
462
+ }
463
+ if (togglePlayTimeout.current !== null) {
464
+ clearTimeout(togglePlayTimeout.current);
465
+ togglePlayTimeout.current = null;
343
466
  }
344
467
  }
345
- if (togglePlayTimeout.current !== null) {
346
- clearTimeout(togglePlayTimeout.current);
347
- togglePlayTimeout.current = null;
468
+ pointerDown.current = false;
469
+ };
470
+ $[47] = gotoNextScreen;
471
+ $[48] = gotoPreviousScreen;
472
+ $[49] = landscape;
473
+ $[50] = t34;
474
+ } else {
475
+ t34 = $[50];
476
+ }
477
+ const onPointerUp = t34;
478
+ const t35 = isPreview || isStatic || isCapture;
479
+ let t36;
480
+ if ($[51] !== className || $[52] !== t35) {
481
+ t36 = classNames([styles.container, className, {
482
+ [styles.showVideo]: t35
483
+ }]);
484
+ $[51] = className;
485
+ $[52] = t35;
486
+ $[53] = t36;
487
+ } else {
488
+ t36 = $[53];
489
+ }
490
+ const t37 = (isStatic || isCapture) && posterReady || ready;
491
+ let t38;
492
+ if ($[54] !== resizedImageHeight || $[55] !== resizedImageLeft || $[56] !== resizedImageTop || $[57] !== resizedImageWidth) {
493
+ t38 = /*#__PURE__*/jsx("div", {
494
+ ref: canvasContainerRef,
495
+ className: styles.videoContainer,
496
+ style: {
497
+ width: resizedImageWidth,
498
+ height: resizedImageHeight,
499
+ left: resizedImageLeft,
500
+ top: resizedImageTop
348
501
  }
349
- }
350
- pointerDown.current = false;
351
- }, [gotoPreviousScreen, gotoNextScreen, landscape]);
352
- return /*#__PURE__*/jsxs("div", {
353
- className: classNames([styles.container, className, _defineProperty({}, styles.showVideo, isPreview || isStatic || isCapture)]),
354
- "data-screen-ready": (isStatic || isCapture) && posterReady || ready,
355
- children: [/*#__PURE__*/jsxs(Container, {
502
+ });
503
+ $[54] = resizedImageHeight;
504
+ $[55] = resizedImageLeft;
505
+ $[56] = resizedImageTop;
506
+ $[57] = resizedImageWidth;
507
+ $[58] = t38;
508
+ } else {
509
+ t38 = $[58];
510
+ }
511
+ let t39;
512
+ if ($[59] !== hasHeader || $[60] !== header || $[61] !== isPlaceholder || $[62] !== spacing) {
513
+ t39 = !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
514
+ className: styles.header,
515
+ style: {
516
+ paddingTop: spacing / 2,
517
+ paddingLeft: spacing,
518
+ paddingRight: spacing
519
+ },
520
+ children: /*#__PURE__*/jsx(Header, {
521
+ ...header
522
+ })
523
+ }) : null;
524
+ $[59] = hasHeader;
525
+ $[60] = header;
526
+ $[61] = isPlaceholder;
527
+ $[62] = spacing;
528
+ $[63] = t39;
529
+ } else {
530
+ t39 = $[63];
531
+ }
532
+ let t40;
533
+ if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
534
+ t40 = /*#__PURE__*/jsx(PlaceholderVideo360, {
535
+ className: styles.placeholder,
536
+ width: "100%",
537
+ height: "100%"
538
+ });
539
+ $[64] = t40;
540
+ } else {
541
+ t40 = $[64];
542
+ }
543
+ let t41;
544
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
545
+ t41 = /*#__PURE__*/jsx(FormattedMessage, {
546
+ id: "/YQ+xP",
547
+ defaultMessage: "Image 360"
548
+ });
549
+ $[65] = t41;
550
+ } else {
551
+ t41 = $[65];
552
+ }
553
+ const t42 = !withSphere;
554
+ let t43;
555
+ if ($[66] !== current || $[67] !== imageHeight || $[68] !== imageWidth || $[69] !== isView || $[70] !== mediaShouldLoad || $[71] !== onPointerMove || $[72] !== onPointerUp || $[73] !== resizedImageHeight || $[74] !== resizedImageLeft || $[75] !== resizedImageTop || $[76] !== resizedImageWidth || $[77] !== resolution || $[78] !== thumbnailUrl || $[79] !== withSphere) {
556
+ t43 = withSphere ? /*#__PURE__*/jsxs(Fragment, {
557
+ children: [/*#__PURE__*/jsx("canvas", {
558
+ ref: canvasRef,
559
+ className: styles.canvas
560
+ }), /*#__PURE__*/jsx("button", {
561
+ className: styles.canvasButton,
562
+ type: "button",
563
+ "aria-label": "canvas-interaction",
564
+ onPointerDown: onPointerDown,
565
+ onPointerMove: onPointerMove,
566
+ onPointerUp: onPointerUp,
567
+ tabIndex: current && isView ? null : "-1"
568
+ })]
569
+ }) : /*#__PURE__*/jsx("div", {
570
+ className: styles.videoContainer,
571
+ style: {
572
+ width: resizedImageWidth,
573
+ height: resizedImageHeight,
574
+ left: resizedImageLeft,
575
+ top: resizedImageTop
576
+ },
577
+ children: /*#__PURE__*/jsx(Image, {
578
+ className: styles.video,
579
+ media: {
580
+ url: thumbnailUrl,
581
+ metadata: {
582
+ width: imageWidth,
583
+ height: imageHeight
584
+ }
585
+ },
586
+ width: resizedImageWidth,
587
+ height: resizedImageHeight,
588
+ resolution: resolution,
589
+ shouldLoad: mediaShouldLoad
590
+ })
591
+ });
592
+ $[66] = current;
593
+ $[67] = imageHeight;
594
+ $[68] = imageWidth;
595
+ $[69] = isView;
596
+ $[70] = mediaShouldLoad;
597
+ $[71] = onPointerMove;
598
+ $[72] = onPointerUp;
599
+ $[73] = resizedImageHeight;
600
+ $[74] = resizedImageLeft;
601
+ $[75] = resizedImageTop;
602
+ $[76] = resizedImageWidth;
603
+ $[77] = resolution;
604
+ $[78] = thumbnailUrl;
605
+ $[79] = withSphere;
606
+ $[80] = t43;
607
+ } else {
608
+ t43 = $[80];
609
+ }
610
+ let t44;
611
+ if ($[81] !== t42 || $[82] !== t43) {
612
+ t44 = /*#__PURE__*/jsx(ScreenElement, {
613
+ placeholder: t40,
614
+ emptyClassName: styles.empty,
615
+ emptyLabel: t41,
616
+ isEmpty: t42,
617
+ children: t43
618
+ });
619
+ $[81] = t42;
620
+ $[82] = t43;
621
+ $[83] = t44;
622
+ } else {
623
+ t44 = $[83];
624
+ }
625
+ let t45;
626
+ if ($[84] !== current || $[85] !== footerProps || $[86] !== hasFooter || $[87] !== isPlaceholder || $[88] !== isPreview || $[89] !== spacing || $[90] !== viewerBottomHeight || $[91] !== viewerBottomSidesWidth) {
627
+ t45 = !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
628
+ className: styles.footer,
629
+ style: {
630
+ transform: current && !isPreview ? `translate(0, -${viewerBottomHeight}px)` : null,
631
+ paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
632
+ paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
633
+ paddingBottom: spacing / 2,
634
+ paddingTop: 0
635
+ },
636
+ children: /*#__PURE__*/jsx(Footer, {
637
+ ...footerProps
638
+ })
639
+ }) : null;
640
+ $[84] = current;
641
+ $[85] = footerProps;
642
+ $[86] = hasFooter;
643
+ $[87] = isPlaceholder;
644
+ $[88] = isPreview;
645
+ $[89] = spacing;
646
+ $[90] = viewerBottomHeight;
647
+ $[91] = viewerBottomSidesWidth;
648
+ $[92] = t45;
649
+ } else {
650
+ t45 = $[92];
651
+ }
652
+ let t46;
653
+ if ($[93] !== t39 || $[94] !== t44 || $[95] !== t45) {
654
+ t46 = /*#__PURE__*/jsxs("div", {
655
+ className: styles.inner,
656
+ children: [t39, t44, t45]
657
+ });
658
+ $[93] = t39;
659
+ $[94] = t44;
660
+ $[95] = t45;
661
+ $[96] = t46;
662
+ } else {
663
+ t46 = $[96];
664
+ }
665
+ let t47;
666
+ if ($[97] !== height || $[98] !== t38 || $[99] !== t46 || $[100] !== width) {
667
+ t47 = /*#__PURE__*/jsxs(Container, {
356
668
  width: width,
357
669
  height: height,
358
670
  className: styles.content,
359
- children: [/*#__PURE__*/jsx("div", {
360
- ref: canvasContainerRef,
361
- className: styles.videoContainer,
362
- style: {
363
- width: resizedImageWidth,
364
- height: resizedImageHeight,
365
- left: resizedImageLeft,
366
- top: resizedImageTop
367
- }
368
- }), /*#__PURE__*/jsxs("div", {
369
- className: styles.inner,
370
- children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
371
- className: styles.header,
372
- style: {
373
- paddingTop: spacing / 2,
374
- paddingLeft: spacing,
375
- paddingRight: spacing
376
- },
377
- children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
378
- }) : null, /*#__PURE__*/jsx(ScreenElement, {
379
- placeholder: /*#__PURE__*/jsx(PlaceholderVideo360, {
380
- className: styles.placeholder,
381
- width: "100%",
382
- height: "100%"
383
- }),
384
- emptyClassName: styles.empty,
385
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
386
- id: "/YQ+xP",
387
- defaultMessage: [{
388
- "type": 0,
389
- "value": "Image 360"
390
- }]
391
- }),
392
- isEmpty: !withSphere,
393
- children: withSphere ? /*#__PURE__*/jsxs(Fragment, {
394
- children: [/*#__PURE__*/jsx("canvas", {
395
- ref: canvasRef,
396
- className: styles.canvas
397
- }), /*#__PURE__*/jsx("button", {
398
- className: styles.canvasButton,
399
- type: "button",
400
- "aria-label": "canvas-interaction",
401
- onPointerDown: onPointerDown,
402
- onPointerMove: onPointerMove,
403
- onPointerUp: onPointerUp,
404
- tabIndex: current && isView ? null : '-1'
405
- })]
406
- }) : /*#__PURE__*/jsx("div", {
407
- className: styles.videoContainer,
408
- style: {
409
- width: resizedImageWidth,
410
- height: resizedImageHeight,
411
- left: resizedImageLeft,
412
- top: resizedImageTop
413
- },
414
- children: /*#__PURE__*/jsx(Image, {
415
- className: styles.video,
416
- media: {
417
- url: thumbnailUrl,
418
- metadata: {
419
- width: imageWidth,
420
- height: imageHeight
421
- }
422
- },
423
- width: resizedImageWidth,
424
- height: resizedImageHeight,
425
- resolution: resolution,
426
- shouldLoad: mediaShouldLoad
427
- })
428
- })
429
- }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
430
- className: styles.footer,
431
- style: {
432
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
433
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
434
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
435
- paddingBottom: spacing / 2,
436
- paddingTop: 0
437
- },
438
- children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
439
- }) : null]
440
- })]
441
- }), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
671
+ children: [t38, t46]
672
+ });
673
+ $[97] = height;
674
+ $[98] = t38;
675
+ $[99] = t46;
676
+ $[100] = width;
677
+ $[101] = t47;
678
+ } else {
679
+ t47 = $[101];
680
+ }
681
+ let t48;
682
+ if ($[102] !== background || $[103] !== backgroundPlaying || $[104] !== customMediaRef || $[105] !== height || $[106] !== isPlaceholder || $[107] !== isPreview || $[108] !== mediaRef || $[109] !== mediaShouldLoad || $[110] !== muted || $[111] !== resolution || $[112] !== width) {
683
+ t48 = !isPlaceholder ? /*#__PURE__*/jsx(Background, {
442
684
  background: background,
443
685
  width: width,
444
686
  height: height,
@@ -446,11 +688,41 @@ function Image360Screen(_ref) {
446
688
  playing: backgroundPlaying,
447
689
  muted: muted,
448
690
  shouldLoad: mediaShouldLoad,
449
- mediaRef: mediaRef,
691
+ mediaRef: mergeRefs(mediaRef, customMediaRef),
450
692
  withoutVideo: isPreview,
451
693
  className: styles.background
452
- }) : null]
453
- });
694
+ }) : null;
695
+ $[102] = background;
696
+ $[103] = backgroundPlaying;
697
+ $[104] = customMediaRef;
698
+ $[105] = height;
699
+ $[106] = isPlaceholder;
700
+ $[107] = isPreview;
701
+ $[108] = mediaRef;
702
+ $[109] = mediaShouldLoad;
703
+ $[110] = muted;
704
+ $[111] = resolution;
705
+ $[112] = width;
706
+ $[113] = t48;
707
+ } else {
708
+ t48 = $[113];
709
+ }
710
+ let t49;
711
+ if ($[114] !== t36 || $[115] !== t37 || $[116] !== t47 || $[117] !== t48) {
712
+ t49 = /*#__PURE__*/jsxs("div", {
713
+ className: t36,
714
+ "data-screen-ready": t37,
715
+ children: [t47, t48]
716
+ });
717
+ $[114] = t36;
718
+ $[115] = t37;
719
+ $[116] = t47;
720
+ $[117] = t48;
721
+ $[118] = t49;
722
+ } else {
723
+ t49 = $[118];
724
+ }
725
+ return t49;
454
726
  }
455
727
 
456
728
  // import * as transforms from './transforms/index';
@@ -461,19 +733,13 @@ var definition = {
461
733
  group: {
462
734
  label: defineMessage({
463
735
  id: "+9akmg",
464
- defaultMessage: [{
465
- "type": 0,
466
- "value": "Audio and Video"
467
- }]
736
+ defaultMessage: "Audio and Video"
468
737
  }),
469
738
  order: 5
470
739
  },
471
740
  title: defineMessage({
472
741
  id: "GRVidW",
473
- defaultMessage: [{
474
- "type": 0,
475
- "value": "360 Video"
476
- }]
742
+ defaultMessage: "360 Video"
477
743
  }),
478
744
  component: Image360Screen,
479
745
  layouts: ['full'],
@@ -489,30 +755,21 @@ var definition = {
489
755
  },
490
756
  label: defineMessage({
491
757
  id: "tvl2Zc",
492
- defaultMessage: [{
493
- "type": 0,
494
- "value": "Video"
495
- }]
758
+ defaultMessage: "Video"
496
759
  })
497
760
  }, {
498
761
  name: 'background',
499
762
  type: 'background',
500
763
  label: defineMessage({
501
764
  id: "+MPZRu",
502
- defaultMessage: [{
503
- "type": 0,
504
- "value": "Background"
505
- }]
765
+ defaultMessage: "Background"
506
766
  })
507
767
  }, {
508
768
  name: 'header',
509
769
  type: 'header',
510
770
  label: defineMessage({
511
771
  id: "rhuDxI",
512
- defaultMessage: [{
513
- "type": 0,
514
- "value": "Header"
515
- }]
772
+ defaultMessage: "Header"
516
773
  }),
517
774
  theme: {
518
775
  badge: {
@@ -527,10 +784,7 @@ var definition = {
527
784
  type: 'footer',
528
785
  label: defineMessage({
529
786
  id: "g4nybp",
530
- defaultMessage: [{
531
- "type": 0,
532
- "value": "Footer"
533
- }]
787
+ defaultMessage: "Footer"
534
788
  }),
535
789
  theme: {
536
790
  callToAction: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-image-360",
3
- "version": "0.4.70",
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,25 +53,25 @@
52
53
  "build": "../../scripts/prepare-package.sh --types"
53
54
  },
54
55
  "devDependencies": {
55
- "react": "^18.3.0 || ^19.0.0",
56
- "react-dom": "^18.3.0 || ^19.0.0"
56
+ "react": "^19.0.0",
57
+ "react-dom": "^19.0.0"
57
58
  },
58
59
  "peerDependencies": {
59
- "react": "^18.3.0 || ^19.0.0",
60
- "react-dom": "^18.3.0 || ^19.0.0"
60
+ "react": "^19.0.0",
61
+ "react-dom": "^19.0.0"
61
62
  },
62
63
  "dependencies": {
63
64
  "@babel/runtime": "^7.28.6",
64
65
  "@folklore/size": "^0.1.20",
65
- "@micromag/core": "^0.4.69",
66
- "@micromag/element-background": "^0.4.70",
67
- "@micromag/element-closed-captions": "^0.4.69",
68
- "@micromag/element-container": "^0.4.69",
69
- "@micromag/element-footer": "^0.4.70",
70
- "@micromag/element-header": "^0.4.69",
71
- "@micromag/element-image": "^0.4.69",
72
- "@micromag/element-video": "^0.4.70",
73
- "@micromag/transforms": "^0.4.69",
66
+ "@micromag/core": "^0.4.74",
67
+ "@micromag/element-background": "^0.4.74",
68
+ "@micromag/element-closed-captions": "^0.4.74",
69
+ "@micromag/element-container": "^0.4.74",
70
+ "@micromag/element-footer": "^0.4.74",
71
+ "@micromag/element-header": "^0.4.74",
72
+ "@micromag/element-image": "^0.4.74",
73
+ "@micromag/element-video": "^0.4.74",
74
+ "@micromag/transforms": "^0.4.74",
74
75
  "classnames": "^2.2.6",
75
76
  "lodash": "^4.17.23",
76
77
  "react-intl": "^8.1.3 || ^10.0.0",
@@ -81,6 +82,6 @@
81
82
  "access": "public",
82
83
  "registry": "https://registry.npmjs.org/"
83
84
  },
84
- "gitHead": "4f76a8f1ad594be2aadb4a593da5455da8afc8b6",
85
+ "gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
85
86
  "types": "es/index.d.ts"
86
87
  }