@micromag/screen-image-360 0.4.71 → 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 +2 -2
- package/es/index.js +672 -420
- 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<
|
|
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
|
|
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
|
|
8
|
-
import {
|
|
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 {
|
|
15
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
* Locale loader
|
|
21
19
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
let packageCache = null;
|
|
21
|
+
const useThree = () => {
|
|
24
22
|
// transport
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
31
|
+
return () => {
|
|
35
32
|
canceled = true;
|
|
36
33
|
};
|
|
37
34
|
}
|
|
38
|
-
import('three').then(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
50
|
-
PerspectiveCamera
|
|
51
|
-
SphereBufferGeometry
|
|
52
|
-
VideoTexture
|
|
53
|
-
TextureLoader
|
|
54
|
-
MeshBasicMaterial
|
|
55
|
-
Mesh
|
|
56
|
-
WebGLRenderer
|
|
57
|
-
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
|
-
|
|
59
|
+
package: packageCache
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
62
|
});
|
|
65
|
-
return
|
|
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(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
background
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
310
|
+
return () => {
|
|
311
|
+
if (withSphere) {
|
|
312
|
+
camera.current = null;
|
|
313
|
+
scene.current = null;
|
|
314
|
+
renderer.current = null;
|
|
315
|
+
}
|
|
315
316
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
}
|
|
344
|
-
|
|
462
|
+
}
|
|
463
|
+
if (togglePlayTimeout.current !== null) {
|
|
464
|
+
clearTimeout(togglePlayTimeout.current);
|
|
465
|
+
togglePlayTimeout.current = null;
|
|
345
466
|
}
|
|
346
467
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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: [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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.
|
|
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": "^
|
|
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
65
|
"@folklore/size": "^0.1.20",
|
|
65
|
-
"@micromag/core": "^0.4.
|
|
66
|
-
"@micromag/element-background": "^0.4.
|
|
67
|
-
"@micromag/element-closed-captions": "^0.4.
|
|
68
|
-
"@micromag/element-container": "^0.4.
|
|
69
|
-
"@micromag/element-footer": "^0.4.
|
|
70
|
-
"@micromag/element-header": "^0.4.
|
|
71
|
-
"@micromag/element-image": "^0.4.
|
|
72
|
-
"@micromag/element-video": "^0.4.
|
|
73
|
-
"@micromag/transforms": "^0.4.
|
|
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": "
|
|
85
|
+
"gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
|
|
85
86
|
"types": "es/index.d.ts"
|
|
86
87
|
}
|