@micromag/screen-image-360 0.3.81 → 0.3.89

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.js +14 -6
  2. package/lib/index.js +14 -6
  3. package/package.json +11 -11
package/es/index.js CHANGED
@@ -91,6 +91,8 @@ var propTypes = {
91
91
  onNext: PropTypes.func,
92
92
  type: PropTypes.string,
93
93
  spacing: PropTypes.number,
94
+ enableInteraction: PropTypes.func,
95
+ disableInteraction: PropTypes.func,
94
96
  className: PropTypes.string
95
97
  };
96
98
  var defaultProps = {
@@ -105,6 +107,8 @@ var defaultProps = {
105
107
  onNext: null,
106
108
  type: null,
107
109
  spacing: 20,
110
+ enableInteraction: null,
111
+ disableInteraction: null,
108
112
  className: null
109
113
  };
110
114
 
@@ -122,6 +126,8 @@ var Image360Screen = function Image360Screen(_ref) {
122
126
  onNext = _ref.onNext,
123
127
  type = _ref.type,
124
128
  spacing = _ref.spacing,
129
+ enableInteraction = _ref.enableInteraction,
130
+ disableInteraction = _ref.disableInteraction,
125
131
  className = _ref.className;
126
132
  var THREE = useThree();
127
133
  var trackScreenEvent = useTrackScreenEvent(type);
@@ -201,8 +207,8 @@ var Image360Screen = function Image360Screen(_ref) {
201
207
  var lon = useRef(0);
202
208
  var lat = useRef(0);
203
209
  var phi = useRef(0);
204
- var theta = useRef(0);
205
- useRef(50);
210
+ var theta = useRef(0); // const distance = useRef(50);
211
+
206
212
  var pointerDown = useRef(false);
207
213
  var pointerDownX = useRef(0);
208
214
  var pointerDownY = useRef(0);
@@ -212,9 +218,8 @@ var Image360Screen = function Image360Screen(_ref) {
212
218
  var render3D = useCallback(function () {
213
219
  if (THREE === null) {
214
220
  return;
215
- }
216
-
217
- THREE.MathUtils; // lat.current = Math.max(-85, Math.min(85, lat.current));
221
+ } // const { MathUtils } = THREE;
222
+ // lat.current = Math.max(-85, Math.min(85, lat.current));
218
223
  // phi.current = MathUtils.degToRad(90 - lat.current);
219
224
  // theta.current = MathUtils.degToRad(lon.current);
220
225
  // camera.current.position.x =
@@ -224,6 +229,7 @@ var Image360Screen = function Image360Screen(_ref) {
224
229
  // distance.current * Math.sin(phi.current) * Math.sin(theta.current);
225
230
  // camera.current.lookAt(0, 0, 0);
226
231
 
232
+
227
233
  lat.current = Math.max(-85, Math.min(85, lat.current));
228
234
  phi.current = THREE.MathUtils.degToRad(90 - lat.current);
229
235
  theta.current = THREE.MathUtils.degToRad(lon.current);
@@ -444,7 +450,9 @@ var Image360Screen = function Image360Screen(_ref) {
444
450
  screenSize: {
445
451
  width: width,
446
452
  height: height
447
- }
453
+ },
454
+ enableInteraction: enableInteraction,
455
+ disableInteraction: disableInteraction
448
456
  })) : null)) : null];
449
457
  return /*#__PURE__*/React.createElement("div", {
450
458
  className: classNames([styles.container, (_ref6 = {}, _defineProperty(_ref6, className, className !== null), _defineProperty(_ref6, styles.showVideo, isPreview || isStatic || isCapture), _ref6)]),
package/lib/index.js CHANGED
@@ -127,6 +127,8 @@ var propTypes = {
127
127
  onNext: PropTypes__default["default"].func,
128
128
  type: PropTypes__default["default"].string,
129
129
  spacing: PropTypes__default["default"].number,
130
+ enableInteraction: PropTypes__default["default"].func,
131
+ disableInteraction: PropTypes__default["default"].func,
130
132
  className: PropTypes__default["default"].string
131
133
  };
132
134
  var defaultProps = {
@@ -141,6 +143,8 @@ var defaultProps = {
141
143
  onNext: null,
142
144
  type: null,
143
145
  spacing: 20,
146
+ enableInteraction: null,
147
+ disableInteraction: null,
144
148
  className: null
145
149
  };
146
150
 
@@ -158,6 +162,8 @@ var Image360Screen = function Image360Screen(_ref) {
158
162
  onNext = _ref.onNext,
159
163
  type = _ref.type,
160
164
  spacing = _ref.spacing,
165
+ enableInteraction = _ref.enableInteraction,
166
+ disableInteraction = _ref.disableInteraction,
161
167
  className = _ref.className;
162
168
  var THREE = useThree();
163
169
  var trackScreenEvent = hooks.useTrackScreenEvent(type);
@@ -237,8 +243,8 @@ var Image360Screen = function Image360Screen(_ref) {
237
243
  var lon = React.useRef(0);
238
244
  var lat = React.useRef(0);
239
245
  var phi = React.useRef(0);
240
- var theta = React.useRef(0);
241
- React.useRef(50);
246
+ var theta = React.useRef(0); // const distance = useRef(50);
247
+
242
248
  var pointerDown = React.useRef(false);
243
249
  var pointerDownX = React.useRef(0);
244
250
  var pointerDownY = React.useRef(0);
@@ -248,9 +254,8 @@ var Image360Screen = function Image360Screen(_ref) {
248
254
  var render3D = React.useCallback(function () {
249
255
  if (THREE === null) {
250
256
  return;
251
- }
252
-
253
- THREE.MathUtils; // lat.current = Math.max(-85, Math.min(85, lat.current));
257
+ } // const { MathUtils } = THREE;
258
+ // lat.current = Math.max(-85, Math.min(85, lat.current));
254
259
  // phi.current = MathUtils.degToRad(90 - lat.current);
255
260
  // theta.current = MathUtils.degToRad(lon.current);
256
261
  // camera.current.position.x =
@@ -260,6 +265,7 @@ var Image360Screen = function Image360Screen(_ref) {
260
265
  // distance.current * Math.sin(phi.current) * Math.sin(theta.current);
261
266
  // camera.current.lookAt(0, 0, 0);
262
267
 
268
+
263
269
  lat.current = Math.max(-85, Math.min(85, lat.current));
264
270
  phi.current = THREE.MathUtils.degToRad(90 - lat.current);
265
271
  theta.current = THREE.MathUtils.degToRad(lon.current);
@@ -480,7 +486,9 @@ var Image360Screen = function Image360Screen(_ref) {
480
486
  screenSize: {
481
487
  width: width,
482
488
  height: height
483
- }
489
+ },
490
+ enableInteraction: enableInteraction,
491
+ disableInteraction: disableInteraction
484
492
  })) : null)) : null];
485
493
  return /*#__PURE__*/React__default["default"].createElement("div", {
486
494
  className: classNames__default["default"]([styles.container, (_ref6 = {}, _defineProperty__default["default"](_ref6, className, className !== null), _defineProperty__default["default"](_ref6, styles.showVideo, isPreview || isStatic || isCapture), _ref6)]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-image-360",
3
- "version": "0.3.81",
3
+ "version": "0.3.89",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -50,15 +50,15 @@
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
52
  "@folklore/size": "^0.1.20",
53
- "@micromag/core": "^0.3.81",
54
- "@micromag/element-background": "^0.3.81",
55
- "@micromag/element-call-to-action": "^0.3.81",
56
- "@micromag/element-closed-captions": "^0.3.81",
57
- "@micromag/element-container": "^0.3.81",
58
- "@micromag/element-image": "^0.3.81",
59
- "@micromag/element-media-controls": "^0.3.81",
60
- "@micromag/element-video": "^0.3.81",
61
- "@micromag/transforms": "^0.3.81",
53
+ "@micromag/core": "^0.3.88",
54
+ "@micromag/element-background": "^0.3.88",
55
+ "@micromag/element-call-to-action": "^0.3.89",
56
+ "@micromag/element-closed-captions": "^0.3.88",
57
+ "@micromag/element-container": "^0.3.88",
58
+ "@micromag/element-image": "^0.3.88",
59
+ "@micromag/element-media-controls": "^0.3.88",
60
+ "@micromag/element-video": "^0.3.88",
61
+ "@micromag/transforms": "^0.3.88",
62
62
  "classnames": "^2.2.6",
63
63
  "lodash": "^4.17.21",
64
64
  "prop-types": "^15.7.2",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "4fec1502a42a4813cc39e24de20c6cd47134cc62"
73
+ "gitHead": "b79d346163c149050ed713e8162675f11b8baf4b"
74
74
  }