@micromag/screen-image-360 0.4.71 → 0.4.76

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 +2 -2
  2. package/es/index.js +672 -420
  3. package/package.json +16 -15
package/es/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ForwardedRef } from 'react';
3
- import { ImageMedia, BackgroundElement, Header, Footer } from '@micromag/core';
3
+ import { ImageMedia, BackgroundElement, Header, Footer, MediaElement } from '@micromag/core';
4
4
 
5
5
  interface Image360ScreenProps {
6
6
  layout?: 'full';
@@ -12,7 +12,7 @@ interface Image360ScreenProps {
12
12
  preload?: boolean;
13
13
  type?: string | null;
14
14
  spacing?: number;
15
- mediaRef?: ForwardedRef<HTMLMediaElement> | null;
15
+ mediaRef?: ForwardedRef<MediaElement> | null;
16
16
  className?: string | null;
17
17
  }
18
18
  declare function Image360Screen({ layout: _layout, image, background, header, footer, current, preload, type, spacing, mediaRef: customMediaRef, className, }: Image360ScreenProps): react_jsx_runtime.JSX.Element;
package/es/index.js CHANGED
@@ -1,11 +1,9 @@
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
9
  import { isHeaderFilled, isFooterFilled, getFooterProps, mergeRefs } from '@micromag/core/utils';
@@ -14,55 +12,55 @@ 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,376 +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$mediaRef = _ref.mediaRef,
93
- customMediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
94
- _ref$className = _ref.className,
95
- className = _ref$className === void 0 ? null : _ref$className;
96
- var THREE = useThree();
97
- var trackScreenEvent = useTrackScreenEvent(type);
98
- var _useScreenRenderConte = useScreenRenderContext(),
99
- isView = _useScreenRenderConte.isView,
100
- isPreview = _useScreenRenderConte.isPreview,
101
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
102
- isEdit = _useScreenRenderConte.isEdit,
103
- isStatic = _useScreenRenderConte.isStatic,
104
- isCapture = _useScreenRenderConte.isCapture;
105
- var _useScreenSize = useScreenSize(),
106
- width = _useScreenSize.width,
107
- height = _useScreenSize.height,
108
- landscape = _useScreenSize.landscape,
109
- resolution = _useScreenSize.resolution;
110
- var _useViewerNavigation = useViewerNavigation(),
111
- gotoPreviousScreen = _useViewerNavigation.gotoPreviousScreen,
112
- gotoNextScreen = _useViewerNavigation.gotoNextScreen;
113
- var _useViewerWebView = useViewerWebView(),
114
- openWebView = _useViewerWebView.open;
115
- var _useViewerContext = useViewerContext(),
116
- viewerBottomHeight = _useViewerContext.bottomHeight,
117
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
118
- var _usePlaybackContext = usePlaybackContext(),
119
- muted = _usePlaybackContext.muted;
120
- var _usePlaybackMediaRef = usePlaybackMediaRef(current, true),
121
- mediaRef = _usePlaybackMediaRef.ref,
122
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
123
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
124
- var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
125
- var mediaShouldLoad = current || preload;
126
- var canvasContainerRef = useRef();
127
- var devicePixelRatio = useDevicePixelRatio();
128
-
129
- // ------------------------------------
130
-
131
- var hasMedia = image !== null;
132
- var hasHeader = isHeaderFilled(header);
133
- var hasFooter = isFooterFilled(footer);
134
- var footerProps = getFooterProps(footer, {
135
- isView: isView,
136
- current: current,
137
- openWebView: openWebView,
138
- 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
139
197
  });
140
- var _useState = useState(!hasMedia),
141
- _useState2 = _slicedToArray(_useState, 2),
142
- ready = _useState2[0],
143
- setReady = _useState2[1];
144
- var _ref2 = image || {},
145
- _ref2$metadata = _ref2.metadata,
146
- imageMetadata = _ref2$metadata === void 0 ? null : _ref2$metadata,
147
- _ref2$url = _ref2.url,
148
- imageUrl = _ref2$url === void 0 ? null : _ref2$url,
149
- _ref2$thumbnail_url = _ref2.thumbnail_url,
150
- thumbnailUrl = _ref2$thumbnail_url === void 0 ? null : _ref2$thumbnail_url;
151
- var hasMediaUrl = imageUrl !== null;
152
- var _ref3 = imageMetadata || {},
153
- _ref3$width = _ref3.width,
154
- imageWidth = _ref3$width === void 0 ? 0 : _ref3$width,
155
- _ref3$height = _ref3.height,
156
- imageHeight = _ref3$height === void 0 ? 0 : _ref3$height;
157
- var hasThumbnail = thumbnailUrl !== null;
158
- var _useState3 = useState(!hasThumbnail),
159
- _useState4 = _slicedToArray(_useState3, 2),
160
- posterReady = _useState4[0],
161
- setPosterReady = _useState4[1];
162
- var withSphere = hasMediaUrl && (isView || isEdit) && !isCapture && !isStatic;
163
- var _getSizeWithinBounds = getSizeWithinBounds(imageWidth, imageHeight, width, height, {
164
- cover: true
165
- }),
166
- resizedImageWidth = _getSizeWithinBounds.width,
167
- resizedImageHeight = _getSizeWithinBounds.height;
168
- var resizedImageLeft = -(resizedImageWidth - width) / 2;
169
- var resizedImageTop = -(resizedImageHeight - height) / 2;
170
- useEffect(function () {
171
- setReady(!hasMediaUrl);
172
- }, [imageUrl, hasMediaUrl, setReady]);
173
- useEffect(function () {
174
- setPosterReady(!hasThumbnail);
175
- }, [thumbnailUrl, hasThumbnail, setPosterReady]);
176
-
177
- // 3D layer --------------------------
178
-
179
- var canvasRef = useRef(null);
180
- var camera = useRef(null);
181
- var scene = useRef(null);
182
- var renderer = useRef(null);
183
- var lon = useRef(0);
184
- var lat = useRef(0);
185
- var phi = useRef(0);
186
- var theta = useRef(0);
187
- // const distance = useRef(50);
188
- var pointerDown = useRef(false);
189
- var pointerDownX = useRef(0);
190
- var pointerDownY = useRef(0);
191
- var pointerLon = useRef(0);
192
- var pointerLat = useRef(0);
193
-
194
- // render 3D frame
195
-
196
- var render3D = useCallback(function () {
197
- if (THREE === null) {
198
- return;
199
- }
200
-
201
- // const { MathUtils } = THREE;
202
- // lat.current = Math.max(-85, Math.min(85, lat.current));
203
- // phi.current = MathUtils.degToRad(90 - lat.current);
204
- // theta.current = MathUtils.degToRad(lon.current);
205
-
206
- // camera.current.position.x =
207
- // distance.current * Math.sin(phi.current) * Math.cos(theta.current);
208
- // camera.current.position.y = distance.current * Math.cos(phi.current);
209
- // camera.current.position.z =
210
- // distance.current * Math.sin(phi.current) * Math.sin(theta.current);
211
-
212
- // camera.current.lookAt(0, 0, 0);
213
-
214
- lat.current = Math.max(-85, Math.min(85, lat.current));
215
- phi.current = THREE.MathUtils.degToRad(90 - lat.current);
216
- theta.current = THREE.MathUtils.degToRad(lon.current);
217
- var x = 500 * Math.sin(phi.current) * Math.cos(theta.current);
218
- var y = 500 * Math.cos(phi.current);
219
- var z = 500 * Math.sin(phi.current) * Math.sin(theta.current);
220
- camera.current.lookAt(x, y, z);
221
- renderer.current.render(scene.current, camera.current);
222
- }, [THREE]);
223
-
224
- // Init 3D layer
225
-
226
- useEffect(function () {
227
- if (THREE !== null && hasMediaUrl && withSphere) {
228
- var Scene = THREE.Scene,
229
- PerspectiveCamera = THREE.PerspectiveCamera,
230
- SphereBufferGeometry = THREE.SphereBufferGeometry,
231
- MeshBasicMaterial = THREE.MeshBasicMaterial,
232
- Mesh = THREE.Mesh,
233
- WebGLRenderer = THREE.WebGLRenderer,
234
- TextureLoader = THREE.TextureLoader;
235
- var _canvasRef$current = canvasRef.current,
236
- canvasWidth = _canvasRef$current.offsetWidth,
237
- canvasHeight = _canvasRef$current.offsetHeight;
238
- camera.current = new PerspectiveCamera(50, canvasWidth / canvasHeight, 1, 1100);
239
- scene.current = new Scene();
240
- var geometry = new SphereBufferGeometry(500, 60, 40, 0, Math.PI * 2, Math.PI / 3, Math.PI / 3);
241
- geometry.scale(-1, 1, 1);
242
- var texture = new TextureLoader().load(imageUrl);
243
- var material = new MeshBasicMaterial({
244
- map: texture
245
- });
246
- var mesh = new Mesh(geometry, material);
247
- scene.current.add(mesh);
248
- renderer.current = new WebGLRenderer({
249
- canvas: canvasRef.current
250
- });
251
- renderer.current.setPixelRatio(devicePixelRatio);
252
- renderer.current.setSize(canvasWidth, canvasHeight);
253
- render3D();
254
- }
255
- return function () {
256
- if (withSphere) {
257
- camera.current = null;
258
- scene.current = null;
259
- 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;
260
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);
261
269
  };
262
- }, [hasMediaUrl, withSphere, render3D, THREE]);
263
- useAnimationFrame(render3D, {
264
- disabled: !withSphere || THREE === null
265
- });
266
-
267
- // Resize 3D layer
268
-
269
- useEffect(function () {
270
- if (camera.current !== null && renderer.current !== null) {
271
- camera.current.aspect = width / height;
272
- camera.current.updateProjectionMatrix();
273
- renderer.current.setSize(width, height);
274
- }
275
- }, [width, height]);
276
-
277
- // Pointer interaction
278
- var togglePlayTimeout = useRef(null);
279
- var onPointerDown = useCallback(function (e) {
280
- pointerDown.current = true;
281
- pointerDownX.current = e.clientX;
282
- pointerDownY.current = e.clientY;
283
- pointerLon.current = lon.current;
284
- pointerLat.current = lat.current;
285
- }, []);
286
- var pixelsMoved = useRef(0);
287
- var lastPointerClient = useRef(null);
288
- var pixelsMovedTracked = useRef(false);
289
- var onPointerMove = useCallback(function (e) {
290
- if (pointerDown.current) {
291
- var _ref4 = e || {},
292
- _ref4$clientX = _ref4.clientX,
293
- clientX = _ref4$clientX === void 0 ? null : _ref4$clientX,
294
- _ref4$clientY = _ref4.clientY,
295
- clientY = _ref4$clientY === void 0 ? null : _ref4$clientY;
296
- var downDeltaX = pointerDownX.current - clientX;
297
- var downDeltaY = pointerDownY.current - clientY;
298
- lon.current = downDeltaX * 0.2 + pointerLon.current;
299
- lat.current = downDeltaY * 0.2 + pointerLat.current;
300
- var _ref5 = lastPointerClient.current || {},
301
- _ref5$x = _ref5.x,
302
- lastX = _ref5$x === void 0 ? clientX : _ref5$x,
303
- _ref5$y = _ref5.y,
304
- lastY = _ref5$y === void 0 ? clientY : _ref5$y;
305
- var deltaX = Math.abs(lastX - clientX) || 0;
306
- var deltaY = Math.abs(lastY - clientY) || 0;
307
- pixelsMoved.current += deltaX + deltaY;
308
- if (!pixelsMovedTracked.current && pixelsMoved.current > Math.min(width, height)) {
309
- trackScreenEvent('drag_sphere');
310
- 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();
311
309
  }
312
- lastPointerClient.current = {
313
- x: clientX,
314
- y: clientY
310
+ return () => {
311
+ if (withSphere) {
312
+ camera.current = null;
313
+ scene.current = null;
314
+ renderer.current = null;
315
+ }
315
316
  };
316
- if (Math.abs(downDeltaX) > 3 || Math.abs(downDeltaY) > 3) {
317
- if (togglePlayTimeout.current !== null) {
318
- clearTimeout(togglePlayTimeout.current);
319
- 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
+ }
320
426
  }
321
427
  }
322
- }
323
- }, [width, height, trackScreenEvent]);
324
- var onPointerUp = useCallback(function (e) {
325
- var canvasContainer = canvasContainerRef.current;
326
- if (pointerDown.current && canvasContainer !== null) {
327
- var distX = Math.abs(pointerDownX.current - e.clientX);
328
- var distY = Math.abs(pointerDownY.current - e.clientY);
329
- var pixelsMovedTolerance = 3;
330
- var tapNextScreenWidthPercent = 0.5;
331
- var canTapToNavigate = !landscape && togglePlayTimeout.current !== null;
332
- var validNavigateTap = canTapToNavigate && distX < pixelsMovedTolerance && distY < pixelsMovedTolerance;
333
- if (validNavigateTap) {
334
- var _canvasContainer$getB = canvasContainer.getBoundingClientRect(),
335
- _canvasContainer$getB2 = _canvasContainer$getB.left,
336
- containerX = _canvasContainer$getB2 === void 0 ? 0 : _canvasContainer$getB2,
337
- containerWidth = _canvasContainer$getB.width;
338
- var hasTappedLeft = e.clientX - containerX < containerWidth * (1 - tapNextScreenWidthPercent);
339
- if (hasTappedLeft) {
340
- if (gotoPreviousScreen !== null) {
341
- 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
+ }
342
461
  }
343
- } else if (gotoNextScreen !== null) {
344
- gotoNextScreen();
462
+ }
463
+ if (togglePlayTimeout.current !== null) {
464
+ clearTimeout(togglePlayTimeout.current);
465
+ togglePlayTimeout.current = null;
345
466
  }
346
467
  }
347
- if (togglePlayTimeout.current !== null) {
348
- clearTimeout(togglePlayTimeout.current);
349
- 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
350
501
  }
351
- }
352
- pointerDown.current = false;
353
- }, [gotoPreviousScreen, gotoNextScreen, landscape]);
354
- return /*#__PURE__*/jsxs("div", {
355
- className: classNames([styles.container, className, _defineProperty({}, styles.showVideo, isPreview || isStatic || isCapture)]),
356
- "data-screen-ready": (isStatic || isCapture) && posterReady || ready,
357
- 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, {
358
668
  width: width,
359
669
  height: height,
360
670
  className: styles.content,
361
- children: [/*#__PURE__*/jsx("div", {
362
- ref: canvasContainerRef,
363
- className: styles.videoContainer,
364
- style: {
365
- width: resizedImageWidth,
366
- height: resizedImageHeight,
367
- left: resizedImageLeft,
368
- top: resizedImageTop
369
- }
370
- }), /*#__PURE__*/jsxs("div", {
371
- className: styles.inner,
372
- children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
373
- className: styles.header,
374
- style: {
375
- paddingTop: spacing / 2,
376
- paddingLeft: spacing,
377
- paddingRight: spacing
378
- },
379
- children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
380
- }) : null, /*#__PURE__*/jsx(ScreenElement, {
381
- placeholder: /*#__PURE__*/jsx(PlaceholderVideo360, {
382
- className: styles.placeholder,
383
- width: "100%",
384
- height: "100%"
385
- }),
386
- emptyClassName: styles.empty,
387
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
388
- id: "/YQ+xP",
389
- defaultMessage: [{
390
- "type": 0,
391
- "value": "Image 360"
392
- }]
393
- }),
394
- isEmpty: !withSphere,
395
- children: withSphere ? /*#__PURE__*/jsxs(Fragment, {
396
- children: [/*#__PURE__*/jsx("canvas", {
397
- ref: canvasRef,
398
- className: styles.canvas
399
- }), /*#__PURE__*/jsx("button", {
400
- className: styles.canvasButton,
401
- type: "button",
402
- "aria-label": "canvas-interaction",
403
- onPointerDown: onPointerDown,
404
- onPointerMove: onPointerMove,
405
- onPointerUp: onPointerUp,
406
- tabIndex: current && isView ? null : '-1'
407
- })]
408
- }) : /*#__PURE__*/jsx("div", {
409
- className: styles.videoContainer,
410
- style: {
411
- width: resizedImageWidth,
412
- height: resizedImageHeight,
413
- left: resizedImageLeft,
414
- top: resizedImageTop
415
- },
416
- children: /*#__PURE__*/jsx(Image, {
417
- className: styles.video,
418
- media: {
419
- url: thumbnailUrl,
420
- metadata: {
421
- width: imageWidth,
422
- height: imageHeight
423
- }
424
- },
425
- width: resizedImageWidth,
426
- height: resizedImageHeight,
427
- resolution: resolution,
428
- shouldLoad: mediaShouldLoad
429
- })
430
- })
431
- }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
432
- className: styles.footer,
433
- style: {
434
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
435
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
436
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
437
- paddingBottom: spacing / 2,
438
- paddingTop: 0
439
- },
440
- children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
441
- }) : null]
442
- })]
443
- }), !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, {
444
684
  background: background,
445
685
  width: width,
446
686
  height: height,
@@ -451,8 +691,38 @@ function Image360Screen(_ref) {
451
691
  mediaRef: mergeRefs(mediaRef, customMediaRef),
452
692
  withoutVideo: isPreview,
453
693
  className: styles.background
454
- }) : null]
455
- });
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;
456
726
  }
457
727
 
458
728
  // import * as transforms from './transforms/index';
@@ -463,19 +733,13 @@ var definition = {
463
733
  group: {
464
734
  label: defineMessage({
465
735
  id: "+9akmg",
466
- defaultMessage: [{
467
- "type": 0,
468
- "value": "Audio and Video"
469
- }]
736
+ defaultMessage: "Audio and Video"
470
737
  }),
471
738
  order: 5
472
739
  },
473
740
  title: defineMessage({
474
741
  id: "GRVidW",
475
- defaultMessage: [{
476
- "type": 0,
477
- "value": "360 Video"
478
- }]
742
+ defaultMessage: "360 Video"
479
743
  }),
480
744
  component: Image360Screen,
481
745
  layouts: ['full'],
@@ -491,30 +755,21 @@ var definition = {
491
755
  },
492
756
  label: defineMessage({
493
757
  id: "tvl2Zc",
494
- defaultMessage: [{
495
- "type": 0,
496
- "value": "Video"
497
- }]
758
+ defaultMessage: "Video"
498
759
  })
499
760
  }, {
500
761
  name: 'background',
501
762
  type: 'background',
502
763
  label: defineMessage({
503
764
  id: "+MPZRu",
504
- defaultMessage: [{
505
- "type": 0,
506
- "value": "Background"
507
- }]
765
+ defaultMessage: "Background"
508
766
  })
509
767
  }, {
510
768
  name: 'header',
511
769
  type: 'header',
512
770
  label: defineMessage({
513
771
  id: "rhuDxI",
514
- defaultMessage: [{
515
- "type": 0,
516
- "value": "Header"
517
- }]
772
+ defaultMessage: "Header"
518
773
  }),
519
774
  theme: {
520
775
  badge: {
@@ -529,10 +784,7 @@ var definition = {
529
784
  type: 'footer',
530
785
  label: defineMessage({
531
786
  id: "g4nybp",
532
- defaultMessage: [{
533
- "type": 0,
534
- "value": "Footer"
535
- }]
787
+ defaultMessage: "Footer"
536
788
  }),
537
789
  theme: {
538
790
  callToAction: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-image-360",
3
- "version": "0.4.71",
3
+ "version": "0.4.76",
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.71",
66
- "@micromag/element-background": "^0.4.71",
67
- "@micromag/element-closed-captions": "^0.4.71",
68
- "@micromag/element-container": "^0.4.71",
69
- "@micromag/element-footer": "^0.4.71",
70
- "@micromag/element-header": "^0.4.71",
71
- "@micromag/element-image": "^0.4.71",
72
- "@micromag/element-video": "^0.4.71",
73
- "@micromag/transforms": "^0.4.71",
66
+ "@micromag/core": "^0.4.74",
67
+ "@micromag/element-background": "^0.4.76",
68
+ "@micromag/element-closed-captions": "^0.4.74",
69
+ "@micromag/element-container": "^0.4.74",
70
+ "@micromag/element-footer": "^0.4.76",
71
+ "@micromag/element-header": "^0.4.74",
72
+ "@micromag/element-image": "^0.4.74",
73
+ "@micromag/element-video": "^0.4.76",
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": "9101554bc5761e32b4a002a10d26800608c69773",
85
+ "gitHead": "42a24f578994b23090271013f136b7f78956b632",
85
86
  "types": "es/index.d.ts"
86
87
  }