@react-three/fiber 8.17.8 → 8.17.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @react-three/fiber
2
2
 
3
+ ## 8.17.9
4
+
5
+ ### Patch Changes
6
+
7
+ - f34de655: fix: add orientation handling
8
+
3
9
  ## 8.17.8
4
10
 
5
11
  ### Patch Changes
@@ -245,8 +245,8 @@ function createRenderer(_roots, _getEventPriority) {
245
245
  });
246
246
  }
247
247
 
248
- // Don't handle text instances, warn on undefined behavior
249
- const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
248
+ // Don't handle text instances, make it no-op
249
+ const handleTextInstance = () => {};
250
250
  const reconciler = Reconciler__default["default"]({
251
251
  createInstance,
252
252
  removeChild,
@@ -245,8 +245,8 @@ function createRenderer(_roots, _getEventPriority) {
245
245
  });
246
246
  }
247
247
 
248
- // Don't handle text instances, warn on undefined behavior
249
- const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
248
+ // Don't handle text instances, make it no-op
249
+ const handleTextInstance = () => {};
250
250
  const reconciler = Reconciler__default["default"]({
251
251
  createInstance,
252
252
  removeChild,
@@ -218,8 +218,8 @@ function createRenderer(_roots, _getEventPriority) {
218
218
  });
219
219
  }
220
220
 
221
- // Don't handle text instances, warn on undefined behavior
222
- const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
221
+ // Don't handle text instances, make it no-op
222
+ const handleTextInstance = () => {};
223
223
  const reconciler = Reconciler({
224
224
  createInstance,
225
225
  removeChild,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-c54ce65e.cjs.dev.js');
5
+ var events = require('./events-31675df9.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var createDebounce = require('debounce');
@@ -75,7 +75,8 @@ function useMeasure({
75
75
  element: null,
76
76
  scrollContainers: null,
77
77
  resizeObserver: null,
78
- lastBounds: bounds
78
+ lastBounds: bounds,
79
+ orientationHandler: null
79
80
  });
80
81
 
81
82
  // set actual debounce values early, so effects know if they should react accordingly
@@ -133,6 +134,9 @@ function useMeasure({
133
134
  state.current.resizeObserver.disconnect();
134
135
  state.current.resizeObserver = null;
135
136
  }
137
+ if (state.current.orientationHandler) {
138
+ screen.orientation.removeEventListener('orientationchange', state.current.orientationHandler);
139
+ }
136
140
  }
137
141
 
138
142
  // add scroll-listeners / observers
@@ -146,6 +150,9 @@ function useMeasure({
146
150
  passive: true
147
151
  }));
148
152
  }
153
+ state.current.orientationHandler = () => {
154
+ scrollChange();
155
+ };
149
156
  }
150
157
 
151
158
  // the ref we expose to the user
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-2e7e6eab.cjs.prod.js');
5
+ var events = require('./events-09858d86.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var createDebounce = require('debounce');
@@ -75,7 +75,8 @@ function useMeasure({
75
75
  element: null,
76
76
  scrollContainers: null,
77
77
  resizeObserver: null,
78
- lastBounds: bounds
78
+ lastBounds: bounds,
79
+ orientationHandler: null
79
80
  });
80
81
 
81
82
  // set actual debounce values early, so effects know if they should react accordingly
@@ -133,6 +134,9 @@ function useMeasure({
133
134
  state.current.resizeObserver.disconnect();
134
135
  state.current.resizeObserver = null;
135
136
  }
137
+ if (state.current.orientationHandler) {
138
+ screen.orientation.removeEventListener('orientationchange', state.current.orientationHandler);
139
+ }
136
140
  }
137
141
 
138
142
  // add scroll-listeners / observers
@@ -146,6 +150,9 @@ function useMeasure({
146
150
  passive: true
147
151
  }));
148
152
  }
153
+ state.current.orientationHandler = () => {
154
+ scrollChange();
155
+ };
149
156
  }
150
157
 
151
158
  // the ref we expose to the user
@@ -1,5 +1,5 @@
1
- import { c as createPointerEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './events-3515660a.esm.js';
2
- export { t as ReactThreeFiber, z as _roots, x as act, p as addAfterEffect, o as addEffect, q as addTail, n as advance, k as applyProps, y as buildGraph, g as context, f as createEvents, c as createPointerEvents, h as createPortal, b as createRoot, l as dispose, c as events, e as extend, s as flushGlobalEffects, v as flushSync, w as getRootState, m as invalidate, j as reconciler, r as render, d as unmountComponentAtNode, F as useFrame, G as useGraph, A as useInstanceHandle, H as useLoader, C as useStore, D as useThree } from './events-3515660a.esm.js';
1
+ import { c as createPointerEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './events-321b05fb.esm.js';
2
+ export { t as ReactThreeFiber, z as _roots, x as act, p as addAfterEffect, o as addEffect, q as addTail, n as advance, k as applyProps, y as buildGraph, g as context, f as createEvents, c as createPointerEvents, h as createPortal, b as createRoot, l as dispose, c as events, e as extend, s as flushGlobalEffects, v as flushSync, w as getRootState, m as invalidate, j as reconciler, r as render, d as unmountComponentAtNode, F as useFrame, G as useGraph, A as useInstanceHandle, H as useLoader, C as useStore, D as useThree } from './events-321b05fb.esm.js';
3
3
  import * as React from 'react';
4
4
  import { useState, useRef, useEffect, useMemo } from 'react';
5
5
  import * as THREE from 'three';
@@ -49,7 +49,8 @@ function useMeasure({
49
49
  element: null,
50
50
  scrollContainers: null,
51
51
  resizeObserver: null,
52
- lastBounds: bounds
52
+ lastBounds: bounds,
53
+ orientationHandler: null
53
54
  });
54
55
 
55
56
  // set actual debounce values early, so effects know if they should react accordingly
@@ -107,6 +108,9 @@ function useMeasure({
107
108
  state.current.resizeObserver.disconnect();
108
109
  state.current.resizeObserver = null;
109
110
  }
111
+ if (state.current.orientationHandler) {
112
+ screen.orientation.removeEventListener('orientationchange', state.current.orientationHandler);
113
+ }
110
114
  }
111
115
 
112
116
  // add scroll-listeners / observers
@@ -120,6 +124,9 @@ function useMeasure({
120
124
  passive: true
121
125
  }));
122
126
  }
127
+ state.current.orientationHandler = () => {
128
+ scrollChange();
129
+ };
123
130
  }
124
131
 
125
132
  // the ref we expose to the user
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-c54ce65e.cjs.dev.js');
5
+ var events = require('../../dist/events-31675df9.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-2e7e6eab.cjs.prod.js');
5
+ var events = require('../../dist/events-09858d86.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -1,5 +1,5 @@
1
- import { c as createPointerEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createEvents } from '../../dist/events-3515660a.esm.js';
2
- export { t as ReactThreeFiber, z as _roots, x as act, p as addAfterEffect, o as addEffect, q as addTail, n as advance, k as applyProps, y as buildGraph, g as context, f as createEvents, c as createPointerEvents, h as createPortal, b as createRoot, l as dispose, e as extend, s as flushGlobalEffects, v as flushSync, w as getRootState, m as invalidate, j as reconciler, r as render, d as unmountComponentAtNode, F as useFrame, G as useGraph, A as useInstanceHandle, H as useLoader, C as useStore, D as useThree } from '../../dist/events-3515660a.esm.js';
1
+ import { c as createPointerEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createEvents } from '../../dist/events-321b05fb.esm.js';
2
+ export { t as ReactThreeFiber, z as _roots, x as act, p as addAfterEffect, o as addEffect, q as addTail, n as advance, k as applyProps, y as buildGraph, g as context, f as createEvents, c as createPointerEvents, h as createPortal, b as createRoot, l as dispose, e as extend, s as flushGlobalEffects, v as flushSync, w as getRootState, m as invalidate, j as reconciler, r as render, d as unmountComponentAtNode, F as useFrame, G as useGraph, A as useInstanceHandle, H as useLoader, C as useStore, D as useThree } from '../../dist/events-321b05fb.esm.js';
3
3
  import * as React from 'react';
4
4
  import * as THREE from 'three';
5
5
  import { PanResponder, PixelRatio, View, StyleSheet, Platform, Image, NativeModules } from 'react-native';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.17.8",
3
+ "version": "8.17.9",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",